当我在终端上运行selenium命令,即ant test selenium-ui-functional时。 我得到以下错误
[javac] /home/jbilling/jbilling-4/enterprise/test/functional/com/sapienter/jbilling/selenium/sanity/JBillingSanityTest.java:15: package org.openqa.selenium does not exist
[javac] import org.openqa.selenium.*;
[javac] ^
[javac] /home/jbilling/jbilling-4/enterprise/test/functional/com/sapienter/jbilling/selenium/sanity/JBillingSanityTest.java:16: package org.openqa.selenium does not exist
[javac] import org.openqa.selenium.By;
[javac] ^
[javac] /home/jbilling/jbilling-4/enterprise/test/functional/com/sapienter/jbilling/selenium/sanity/JBillingSanityTest.java:17: package org.openqa.selenium does not exist
[javac] import org.openqa.selenium.Alert;
[javac] ^
[javac] /home/jbilling/jbilling-4/enterprise/test/functional/com/sapienter/jbilling/selenium/sanity/JBillingSanityTest.java:18: package org.openqa.selenium.firefox does not exist
[javac] import org.openqa.selenium.firefox.FirefoxDriver;
[javac] ^
[javac] /home/jbilling/jbilling-4/enterprise/test/functional/com/sapienter/jbilling/selenium/sanity/JBillingSanityTest.java:19: package org.openqa.selenium.support.ui does not exist
[javac] import org.openqa.selenium.support.ui.Select;
[javac] ^
[javac] /home/jbilling/jbilling-4/enterprise/test/functional/com/sapienter/jbilling/selenium/sanity/JBillingSanityTest.java:24: cannot find symbol
[javac] symbol : class WebDriver
[javac] location: class com.sapienter.jbilling.selenium.sanity.JBillingSanityTest
[javac] private WebDriver driver;
[javac] ^
[javac] /home/jbilling/jbilling-4/enterprise/test/functional/com/sapienter/jbilling/selenium/sanity/JBillingSanityTest.java:31: cannot find symbol
[javac] symbol : class FirefoxDriver
[javac] location: class com.sapienter.jbilling.selenium.sanity.JBillingSanityTest
[javac] driver = new FirefoxDriver();
[javac] ^
[javac] /home/jbilling/jbilling-4/enterprise/test/functional/com/sapienter/jbilling/server/payment/WSTest.java:317: cannot find symbol
[javac] symbol : variable STATUS_SUSPENDED
[javac] location: class com.sapienter.jbilling.server.user.UserDTOEx
[javac] user.setStatusId(UserDTOEx.STATUS_SUSPENDED);
[javac] ^
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 8 errors
BUILD FAILED
/home/jbilling/jbilling-4/enterprise/build.xml:122: The following error occurred while executing this line:
/home/jbilling/jbilling-4/enterprise/build.xml:185: Compile failed; see the compiler error output for details.
Total time: 12 seconds
我在testlib文件夹中插入了selenium-java-2.40.0.jar,selenium-server-standalone-2.40.0.jar。
拜托,有人可以告诉我这个问题的解决方案吗?
答案 0 :(得分:0)
这个看起来像
您需要确保selenium-java
/ selenium-api
依赖关系具有正确的<scope>...</scope>
答案 1 :(得分:-1)
javac -cp "C:\selenium-2.42.2\selenium-java-2.42.2.jar;selenium-server-standalone-2.42.2.jar" Test.java
java -cp "C:\selenium-2.42.2\selenium-java-2.42.2.jar;.;selenium-server-standalone-2.42.2.jar" Test
测试是java文件名