English 中文(简体)
Opening URL on FirefoxDriver fails with WebDriverException: Could not parse ""
原标题:

I m using Selenium Webdriver to do some robottesting. Since some functions appear to only work in Firefox, I m obligated to use Firefoxdriver. Now and then, something weird happens. Starting up te driver

driver = new FirefoxDriver();
driver.get(URL);

gets firefox to startup but not to go to the specified url. The strange thing is that it works on another computer with the same preferences set in Firefox. I solved this problem once by changing to another version of firefox, but this time this doesn t do the trick for me, it did however worked for the other developers. Yes, the error started for all developers on the same time, same day... My first question is: is it a firefox problem or Webdriver problem. Second question: how is it possible that it works on other pc s?

Any help would be very appreciated Thanks

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
问题回答

I suggest you to use latest version of Firefox browser with latest selenium server libraries. Or I think you forgot to include all lib jars on one machine where you are getting problem.

Make sure that the url is prefixed with the proper protocol like http:// . Removing this gave that exception and adding this prevented it.

I think you ve installed multiple versions of Firefox browsers, try uninstalling all and install the latest version... Hope this helps..





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签