

However when I execute the file in my computer the tests are perfectly run, which means that there is a problem with how I have created the JAR file. The JAR file is unable to find the other two associated classes in the Eclipse project. In other words, only the two lines of code in the Main.java class are executed. What happens is the Chrome browser opens momentarily and then closes without opening the 'MyWebsite's' URL.

The problem here is that despite setting up and configuring the environment on other computers with the Selenium webdriver, copying the Test MyWebsite.jar in the third-party computer and running the file by double-clicking it, the tests do not run successfully. Create a new instance of the Chrome driver

The source code of my Java classes is given below: The name of the JAR file is Test MyWebsite.jar. For that I have created a runnable JAR file from Eclipse by clicking on the Export option from the File menu. My aim here is to create a JAR file for my automated tests so that when the file is simply executed, the tests will run on any other system configured with a Selenium environment. I have created a script to perform few automated tests in Selenium for a website using Java in Eclipse.
