Coder Social home page Coder Social logo

Comments (19)

avarabyeu avatar avarabyeu commented on May 19, 2024 2

@Lalesia properties are being loaded from here: PropertiesLoader

If i'd like to override properties you can use jvm\env vars or replace\override it on the code level in Configuration Module

Example of extending TestNG Listener can be found here

from reportportal.

iKozzz avatar iKozzz commented on May 19, 2024 1

Way too odd. I was expecting to see something like
PropertiesLoader.add("my_custom_parts.properties");
or
PropertiesLoader.reload();

usecase1 - I'm using ReportPortalTestNGListener and I want too change Launch name prior to test start but after framework initialization.
usecase2 - I'm using ReportPortalTestNGListener and I want too add more tags after framework initialization

from reportportal.

 avatar commented on May 19, 2024 1

@mohdsgithub Great thanks it works for me too. As it seems, it will override the values present in reportportal.properties if provided via command line ? :)
awesome!!
Also I stored 'rp.enable' parameter value passed from command line. This will enable us to decide whether to send screen shot attachment to RP or not in case of test failure

from reportportal.

avarabyeu avatar avarabyeu commented on May 19, 2024

@iKozzz we can provide method for completely re-initialize guice app context. Will it work for you?

from reportportal.

iKozzz avatar iKozzz commented on May 19, 2024

Yeah, we can run this method on @BeforeSomething

from reportportal.

DzmitryHumianiuk avatar DzmitryHumianiuk commented on May 19, 2024

@avarabyeu up?

from reportportal.

avarabyeu avatar avarabyeu commented on May 19, 2024

Added in 3.0. Additional details on making this will be provided in documentation

from reportportal.

Lalesia avatar Lalesia commented on May 19, 2024

Hi everyone!
Where I can find in documetation this approach?
I really need it right now for project with a lot of modules and projects, so it would be great to change property file in runtime. Thanks

from reportportal.

KunalShokeen432 avatar KunalShokeen432 commented on May 19, 2024

@DzmitryHumianiuk I have written below snippet in 'BeforeSuite' for setting launch name in reportporttal.properties.

PropertiesConfiguration conf = new PropertiesConfiguration("src/main/resources/reportportal.properties");
			conf.setProperty("rp.launch", "Kunal");
			conf.save();

It is set successfully but after Reportportal listener is initialized in suite.xml file.
Is there a way to set it prior Reportportal listener initialization ?

from reportportal.

DzmitryHumianiuk avatar DzmitryHumianiuk commented on May 19, 2024

@iKozzz can you comment on above as well?

from reportportal.

 avatar commented on May 19, 2024

You can achieve using Environment variables. Its working fine for me

from reportportal.

 avatar commented on May 19, 2024

@DzmitryHumianiuk I have written below snippet in 'BeforeSuite' for setting launch name in reportporttal.properties.
PropertiesConfiguration conf = new PropertiesConfiguration("src/main/resources/reportportal.properties");
conf.setProperty("rp.launch", "Kunal");
conf.save();
It is set successfully but after Reportportal listener is initialized in suite.xml file.
Is there a way to set it prior Reportportal listener initialization ?

Create environment variables or pass the value from command line. I am passing it from maven command:
mvn -U -fn -Dsurefire.suiteXmlFiles=D:\testng\webdriver\singleTest.xml -Drp.launch=MOH -Drp.enable=true clean test

from reportportal.

KunalShokeen432 avatar KunalShokeen432 commented on May 19, 2024

@mohdsgithub Great thanks it works for me too. As it seems, it will override the values present in reportportal.properties if provided via command line ? :)

from reportportal.

iKozzz avatar iKozzz commented on May 19, 2024

we came up with custom runner so we can play with properties prior to ReportPortal.listener start

from reportportal.

KunalShokeen432 avatar KunalShokeen432 commented on May 19, 2024

Can anyone of you also look at the issue tagged with RP usage with Selenium Grid.

from reportportal.

 avatar commented on May 19, 2024

@KunalShokeen432 I am using RP with my selenium testng framework.
What exactly r u looking for

from reportportal.

acdurai avatar acdurai commented on May 19, 2024

Hi @DzmitryHumianiuk ,
I'm using selenium with JUNIT 4.12 framework, I would like to update the reportportal.properties file before the Reportportal listener is getting initialized .
Please help me on this

from reportportal.

DzmitryHumianiuk avatar DzmitryHumianiuk commented on May 19, 2024

@acdurai join our community in slack
https://reportportal-slack-auto.herokuapp.com/

and ask in #agent_java channel for help

from reportportal.

acdurai avatar acdurai commented on May 19, 2024

@DzmitryHumianiuk thank you so much

from reportportal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.