简体   繁体   中英

Executing Eclipse Selenium Webdriver Java Code in Command Line?

I'm using Windows Server 2003,and I'm building a webpage and I want a particular testcase(a Java code) to execute when I click a button in that webpage(the webpage is in same server). SO first I have to find a way to run this eclipse java codes in command line.

On doing some research I found I need to install Maven or Ant. But I know this is not really required. I'm not sure which way to go. I prefer not using Maven or Ant. Can someone please tell me the steps to execute These tests in Command line. ALso the environment variables to add Because I'm unable to find QTjava.zip file in jre7 /lib/ext/ folder.

Have a look at the javac and java command line options. Heres what I did to run selenium tests without requiring eclipse or maven/ant.

this compiles your class, with the jar file (i put it in the same directory, but ideally you will put the full path in the qoutemarks:

javac -classpath "selenium-server-standalone-2.33.0.jar" Example.java

Then you can run the generated class via:

java -classpath ".;selenium-server-standalone-2.33.0.jar" Example

Hope that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM