Here's what I am seeing:
1. To clarify, I am using FirefoxDriver (my original wording of the
issue was confusing) and not remote webdriver.
2. In terms of POM dependency, I changed from 2.0a4 to 2.0a5. The same
code is working fine using 2.0a4.
<!--<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium</artifactId>
<version>2.0a4</version>
</dependency>-->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium</artifactId>
<version>2.0a5</version>
</dependency>
3. From debugging it is failing at driver = new
FirefoxDriver(profile); for me. I have a method loadSelenium where I
instantiate my firefox driver.See code snippet and exception below :
log.info("Entering load selenium");
String pathPrefix = "src/main/resources/extensions/";
File xpathExtensionFile = new File(pathPrefix +
"xpath_checker-0.4.3-fx.xpi");
File firebugExtensionFile = new File(pathPrefix + "firebug-1.5.4-
fx.xpi");
FirefoxProfile profile = new FirefoxProfile();
profile.addExtension(xpathExtensionFile);
profile.addExtension(firebugExtensionFile);
driver = new FirefoxDriver(profile);
eventDriver = new
EventFiringWebDriver(driver);
if ("0".equals(screenshot_level)){
eventDriver.register(new AbstractWebDriverEventListener () {
public void onException(Throwable cause, WebDriver d) {
Utilities.captureScreenShot();
log.error("Exception occurred");
}
});
Exception:
java.lang.UnsupportedOperationException: Bad request
(Note: The stack trace from the server side is missing. The locally-
generated stack trace is useless.)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:
104)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
340)
at
org.openqa.selenium.firefox.FirefoxDriver.execute(FirefoxDriver.java:
237)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:
86)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
73)
at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:
141)
at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:
101)
at myads.common.TestEnvironment.loadSelenium(TestEnvironment.java:
314)
at myads.verifypageobjects.TestBilling.setUp(TestBilling.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:
122)
at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:
86)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:
77)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
at
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:
88)
at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:
51)
at org.junit.internal.runners.JUnit4ClassRunner
$1.run(JUnit4ClassRunner.java:44)
at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:
27)
at
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:
37)
at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:
42)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:
46)
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)
On Aug 5, 2:00 am, Simon Stewart <
simon.m.stew...@gmail.com> wrote:
> It may be that I need my morning coffee, but I don't understand what
> this email means. I'll try and tease out some pieces:
>
> * You don't need to run the server for NON-remote webdriver instances at all.
>
> * It's strongly advised that you keep the remote client and the remote
> server on the same version (that is, try not to mix 2.0a4 clients with
> 2.0a5 servers) We're still tweaking things, and this way you can avoid
> any issues caused by version mis-match
>
> * I have no idea where that log message came from. Is it from your
> application? From the webdriver server? What method caused the
> exception to be thrown? What were you expecting to happen? If you were
> using the remote webdriver, you can see in the server logs that it
> "peels" the exception chain to be as slim as possible. Does it contain
> any information?
>
> Simon
>