1

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?

João Farias
11.2k2 gold badges21 silver badges41 bronze badges
asked Jul 26, 2019 at 9:54

1 Answer 1

0

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.

answered Jul 26, 2019 at 11:15
1
  • Obviously you will need Docker installed to run contain er. What's the advantage over installing JRE? Commented Aug 5, 2023 at 5:02

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.