Is it possible to make a jar file using Selenium java and Eclipse and run that file on any machine



  • I am using Selenium and Java with Eclipse and TestNG.

    Now I want to make a .jar file for running this test case on another system that doesn't have Selenium and Java.

    How can this be done?



  • You can run TestNG programatically (more details here😞

    TestListenerAdapter tla = new TestListenerAdapter();
    TestNG testng = new TestNG();
    testng.setTestClasses(new Class[] { Run2.class });
    testng.addListener(tla);
    testng.run();
    

    And together with the Eclipse Export Wizard, you can create an executable for it.

    that don't have ... Java setup

    But naturally you need a JRE to execute .jar

    However, if you simply boot up a container with Selenium, you will be able to manage changes extremely more easily than with executable files. More details here.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2