Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

__EXCEPTION__:org.openqa.selenium.WebDriverException: Unknown command: setTimeout (WARNING: The server did not provide any stacktrace information) #137

Open
sglebs opened this issue Oct 20, 2014 · 3 comments
Labels

Comments

@sglebs
Copy link

sglebs commented Oct 20, 2014

If you run with safari, you will get this in startBroser:

EXCEPTION:org.openqa.selenium.WebDriverException: Unknown command: setTimeout (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1 milliseconds
Build info: version: '2.43.1', revision: '5163bceef1bc36d43f3dc0b83c88998168a363a0', time: '2014-09-10 09:43:55'
System info: host: 'Marcio-Marchinis-MacBook-Pro-Silver.local', ip: '172.23.70.56', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.5', java.version: '1.7.0_67'
Session ID: null
Driver info: org.openqa.selenium.safari.SafariDriver
Capabilities [{platform=MAC, cssSelectorsEnabled=true, javascriptEnabled=true, secureSsl=true, browserName=safari, takesScreenshot=true, version=7.0.6}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_67]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_67]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_67]
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_67]
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204) [selenium-remote-driver-2.43.1.jar]
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156) [selenium-remote-driver-2.43.1.jar]
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599) [selenium-remote-driver-2.43.1.jar]
at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteTimeouts.pageLoadTimeout(RemoteWebDriver.java:782) [selenium-remote-driver-2.43.1.jar]
at com.xebia.incubator.xebium.SeleniumDriverFixture.setTimeoutOnSelenium(SeleniumDriverFixture.java:262) [xebium-0.14-SNAPSHOT-mqm.jar]
at com.xebia.incubator.xebium.SeleniumDriverFixture.startDriverOnUrl(SeleniumDriverFixture.java:153) [xebium-0.14-SNAPSHOT-mqm.jar]
at com.xebia.incubator.xebium.SeleniumDriverFixture.startBrowserOnUrl(SeleniumDriverFixture.java:167) [xebium-0.14-SNAPSHOT-mqm.jar]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_67]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_67]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_67]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_67]
at fitnesse.slim.fixtureInteraction.DefaultInteraction.methodInvoke(DefaultInteraction.java:16) [fitnesse-standalone.jar]
at fitnesse.slim.MethodExecutor.callMethod(MethodExecutor.java:43) [fitnesse-standalone.jar]
at fitnesse.slim.MethodExecutor.invokeMethod(MethodExecutor.java:30) [fitnesse-standalone.jar]
at fitnesse.slim.MethodExecutor.findAndInvoke(MethodExecutor.java:52) [fitnesse-standalone.jar]
at fitnesse.slim.FixtureMethodExecutor.execute(FixtureMethodExecutor.java:20) [fitnesse-standalone.jar]
at fitnesse.slim.StatementExecutor.getMethodExecutionResult(StatementExecutor.java:121) [fitnesse-standalone.jar]
at fitnesse.slim.StatementExecutor.call(StatementExecutor.java:99) [fitnesse-standalone.jar]
at fitnesse.slim.instructions.CallInstruction.executeInternal(CallInstruction.java:35) [fitnesse-standalone.jar]
at fitnesse.slim.instructions.Instruction.execute(Instruction.java:30) [fitnesse-standalone.jar]
at fitnesse.slim.ListExecutor$Executive.executeStatement(ListExecutor.java:50) [fitnesse-standalone.jar]
at fitnesse.slim.ListExecutor$Executive.executeStatements(ListExecutor.java:44) [fitnesse-standalone.jar]
at fitnesse.slim.ListExecutor.execute(ListExecutor.java:84) [fitnesse-standalone.jar]
at fitnesse.slim.SlimServer.executeInstructions(SlimServer.java:107) [fitnesse-standalone.jar]
at fitnesse.slim.SlimServer.processTheInstructions(SlimServer.java:94) [fitnesse-standalone.jar]
at fitnesse.slim.SlimServer.processOneSetOfInstructions(SlimServer.java:68) [fitnesse-standalone.jar]
at fitnesse.slim.SlimServer.tryProcessInstructions(SlimServer.java:54) [fitnesse-standalone.jar]
at fitnesse.slim.SlimServer.serve(SlimServer.java:40) [fitnesse-standalone.jar]
at fitnesse.slim.SlimService.handle(SlimService.java:164) [fitnesse-standalone.jar]
at fitnesse.slim.SlimService.acceptOne(SlimService.java:172) [fitnesse-standalone.jar]
at fitnesse.slim.SlimService.accept(SlimService.java:134) [fitnesse-standalone.jar]
at fitnesse.slim.SlimService.startWithFactory(SlimService.java:65) [fitnesse-standalone.jar]
at fitnesse.slim.SlimService.main(SlimService.java:51) [fitnesse-standalone.jar]

@sglebs
Copy link
Author

sglebs commented Oct 20, 2014

I believe the fix should be something like (in SeleniumDriverFixture):

private void setTimeoutOnSelenium() {
    executeCommand("setTimeout", new String[] { "" + this.timeout });
    WebDriver.Timeouts timeouts = getWebDriver().manage().timeouts();
    timeouts.setScriptTimeout(this.timeout, TimeUnit.MILLISECONDS);
    if (!defaultWebDriverSupplier.getBrowser().toLowerCase().equals("safari"))  //mqm fix for #137 - safari does not support this API
        timeouts.pageLoadTimeout(this.timeout, TimeUnit.MILLISECONDS);
}

And add the getBrowser API to DefaultWebDriverSupplier.

I did this in my fork and it worked.

sglebs pushed a commit to sglebs/Xebium that referenced this issue Oct 20, 2014
@sglebs
Copy link
Author

sglebs commented Oct 20, 2014

@raboof
Copy link
Contributor

raboof commented Jun 29, 2015

This arguably seems like an upstream issue: setting the page load timeout is part of the WebDriver.Timeouts Java API, so if it's not supported by Safari IMHO that's where that should be caught.

Can we file an upstream issue and implement a workaround (with reference to that issue) in Xebium until it's resolved upstream?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants