title: Reportportal with testng - how to set launch name during run time
body: <p>I am looking for a way to set launch name during testng run. This is otherwise set in configuration (rp.launch). I need to set a custom launch name for every testng run. I am using agent-java-testng:4.0.0-BETA-1</p>
  
  <p>I have tried the suggested alternative way but cannot locate the classes that are mentioned here - ConfigurationModule &amp; TestNGAgentModule: <a href="https://github.com/reportportal/agent-java-testNG" rel="nofollow noreferrer">https://github.com/reportportal/agent-java-testNG</a></p>
  
  <pre><code>public class MyListener extends BaseTestNGListener {
      public MyListener() {
          super(Injector.create(Modules.combine(Modules.override(new ConfigurationModule())
                          .with(new Module() {
                              @Override
                              public void configure(Binder binder) {
                                  Properties overrides = new Properties();
                                  overrides.setProperty(ListenerProperty.UUID.getPropertyName(), "my crazy uuid");
                                  PropertiesLoader propertiesLoader = PropertiesLoader.load();
                                  propertiesLoader.overrideWith(overrides);
                                  binder.bind(PropertiesLoader.class).toInstance(propertiesLoader);
                              }
                          }),
                  new ReportPortalClientModule(),
                  new TestNGAgentModule()
          )));
      }
  }
  
  </code></pre>
  
  <p>I have a custom listener (ReportPortalTestNGListener) that I am adding to TestNG</p>
  
  <p>TestNG myTestNG = new TestNG();
  XmlSuite suite = new XmlSuite();
  ...
  List mySuites = new ArrayList();
              mySuites.add(suite);</p>
  
  <pre><code>        ReportPortalTestNGListener listener = new ReportPortalTestNGListener();
  
  
          myTestNG.addListener((Object)listener);
          myTestNG.setUseDefaultListeners(false);
  
          // add test suite
          myTestNG.setXmlSuites(mySuites);
          myTestNG.run();
  </code></pre>