1

I am new to Java and Webdriver (Web QA automation framework). I have wrote a webdriver script which opens firefox browser. Open google.com. Make some searches and finish. N

I have created this script in Eclipse. Using Webdriver (Java), Junit, JDK6, Firefox any version on windows platform. It works fine when I run it in eclipse.

what I want to do is make a run able (executable-jar) file which has all the required classes libraries compiled into it. so that If I want to share this script with any one they don't need to install eclipse or download libraries. I expect them to have Windows, Firefox, JDK or JRE and the file I send them. and that should be all. They should be able to execute my script by double clicking my sent file (or in 1 0r 2 simple steps)

For last one week I have been trying to do this without any success. I select project, go to file, export > java > runnable jar file>

here it asks me for "Launch configuration" by a drop down menu I do not see any launch configuration related to my project listed here

I searched for how to create launch configuration and found that they are automatically made when we run our projects. Apparently that seems not true for Junit (webdriver) java projects.

I am sharing project files and libraries links.

Dropbox link for Project files https://www.dropbox.com/s/ipz95vkfh1m95wj/MakeWebdriverJar.zip

Selenium Webdriver Java Libraries (used in my project) can be downloaded here http://selenium.googlecode.com/files/selenium-java-2.33.0.zip

This is my first posts @ sack over flow. Any help would be really appreciate and make me move forward in my learning. Thank you.

PS: I have read there are ways to do it via terminal but since I am not good at that I want to find a way doing it via eclipse.

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
TestingWithArif
  • 894
  • 2
  • 13
  • 19

3 Answers3

0

A very convenient tool to create a fully runnable jar, that I use for my projects is the FatJAR plugin for eclipse.

It can collect all the required classes into a single jar so you can deploy only one file. Of course you don't have to do it this way, you can choose what it should include and then it compiles the JAR from your selected libraries.

Devolus
  • 21,661
  • 13
  • 66
  • 113
0

just simple, call the all required classes in "Main method" and right click on the Src folder in the eclipse then, click on export the main method in which you would call the required classes.

Adnan Ghaffar
  • 1,345
  • 7
  • 26
  • 46
0

check this http://university.utest.com/selenium-basics-part-4-create-java-project-add-recorded-test-case-run-project/

then add in your class

 public static void main(String[] args) throws Exception {
        JUnitCore.main(
                "qa.vozovoz.ru.TERMTERMSMScode");
    }

then make a jar file

and then start it in cmd

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47