我正在使用 Selenium Webdriver 进行一些机器人测试。由于某些功能似乎只能在 Firefox 中使用,因此我有义务使用 Firefoxdriver。时不时会发生一些奇怪的事情。启动驱动程序
driver = new FirefoxDriver();
driver.get(URL);
让 firefox 启动但不去指定的 url。奇怪的是,它可以在另一台具有 Firefox 中设置的首选项的计算机上运行。我曾经通过更改为另一个版本的 Firefox 解决了这个问题,但这一次对我来说并没有解决问题,但它确实对其他开发人员有用。是的,所有开发人员的错误都是在同一天、同一天开始的……我的第一个问题是:它是 Firefox 问题还是 Webdriver 问题。第二个问题:它怎么可能在其他电脑上工作?
任何帮助将不胜感激谢谢
Error:
org.openqa.selenium.WebDriverException: Could not parse "".
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_18'
Driver info: driver.version: firefox
at org.openqa.selenium.firefox.Response.<init>(Response.java:53)
at org.openqa.selenium.firefox.internal.AbstractExtensionConnection.nextResponse(AbstractExtensionConnection.java:258)
at org.openqa.selenium.firefox.internal.AbstractExtensionConnection.readLoop(AbstractExtensionConnection.java:220)
at org.openqa.selenium.firefox.internal.AbstractExtensionConnection.waitForResponseFor(AbstractExtensionConnection.java:213)
at org.openqa.selenium.firefox.internal.AbstractExtensionConnection.sendMessageAndWaitForResponse(AbstractExtensionConnection.java:162)
at org.openqa.selenium.firefox.FirefoxDriver.executeCommand(FirefoxDriver.java:329)
at org.openqa.selenium.firefox.FirefoxDriver.sendMessage(FirefoxDriver.java:312)
at org.openqa.selenium.firefox.FirefoxDriver.sendMessage(FirefoxDriver.java:308)
at org.openqa.selenium.firefox.FirefoxDriver.fixId(FirefoxDriver.java:350)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:130)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:109)
at be.....MMCRobotTest.login(MMCRobotTest.java:98)
at be.....MMCRobotTestAttribute.testNewAttribute(MMCRobotTestAttribute.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.json.JSONException: A JSONObject text must begin with '{' at character 0
at org.json.JSONTokener.syntaxError(JSONTokener.java:496)
at org.json.JSONObject.<init>(JSONObject.java:180)
at org.json.JSONObject.<init>(JSONObject.java:403)
at org.openqa.selenium.firefox.Response.<init>(Response.java:41)
... 30 more