Can't run Java example for Selenium / WebDriver

前端 未结 3 1331
醉话见心
醉话见心 2020-12-31 13:54

Having a problem getting going with Selenium on Java. I\'m trying to follow the example on this page: http://code.google.com/p/selenium/wiki/GettingStarted

I\'m ty

3条回答
  •  [愿得一人]
    2020-12-31 14:42

    Compile like so:

    javac -classpath selenium-server-standalone-2.20.0.jar Example.java
    

    Unless you put the Java file in the org.openqa.selenium.example, you will have to remove the package specifier. Run the compiled file like so:

    java -cp .:selenium-server-standalone-2.20.0.jar Example
    

    This chains the current directory to the classpath.

提交回复
热议问题