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?
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It only takes a minute to sign up.
Sign up to join this communityYou 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.