Unable to launch chrome with selenium standalone - selenium

I am trying to launch chrome using selenium standalone by using below command
java -Dwebdriver.chrome.driver=chromedriver-new.exe -jar selenium-server.jar standalone --host 127.0.0.1 --port 4444
However when I am triggering my webdriverio test for chrome, it momentarily opens chrome and the it crashes with below error
{"traceId": "faca75a3db657eed4b96bdac93977746","eventTime": 1637343152240678600,"eventName": "exception","attributes": {"driver.url": "http:\u002f\u002flocalhost:57786","exception.message": "Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created\nfrom tab crashed\n (Session info: chrome=96.0.4664.45)\nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: '', ip: '192.168.0.11', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_311'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created\nfrom tab crashed\n (Session info: chrome=96.0.4664.45)\nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: '', ip: '192.168.0.11', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_311'\nDriver info: driver.version: unknown\r\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)\r\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)\r\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)\r\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:131)\r\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:65)\r\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:143)\r\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:315)\r\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:513)\r\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:440)\r\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:648)\r\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:612)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\r\n\tat java.lang.Thread.run(Unknown Source)\r\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.node.config.DriverServiceSessionFactory","session.capabilities": "{"acceptInsecureCerts": true,"browserName": "chrome","goog:chromeOptions": {"args": [ "--disable-gpu" ] } }\n"}}

It worked by adding '--no-sandbox' in chrome options.

Related

Selenium 4, Microsoft Edge(chromium) on Ubuntu

I am currently trying to get my automated tests working on chromium edge on ubuntu.
My current setup is this:
The setup is the following:
The browser is in a docker container with Ubuntu running
The hub is on the official Selenium 4 docker container
The tests or on a separate docker container running .Net Core 2.2
The RemoteWebDriver registration is the following
.....
var edgeOptions = new EdgeOptions();
edgeOptions.UseChromium = true;
edgeOptions.AddUserProfilePreference("download.default_directory", DownloadFolderPath);
edgeOptions.AddArguments("--no-sandbox"); // Bypass OS security model
edgeOptions.AddArguments("--ignore-certificate-errors"); // ignore ssl errors
edgeOptions.AddArgument("--disable-dev-shm-usage"); // ignore shm usage
edgeOptions.AddArguments("--ignore-urlfetcher-cert-requests"); // ignore url cert request fetch
edgeOptions.AddArguments("--force-devtools-available=1"); // ignore url cert request fetch
edgeOptions.AddArguments($"--lang={_language}"); //set browser language from the system properties.
GetEdgeDriver(builder, edgeOptions);
.......
private void GetEdgeRemoteDriver(ContainerBuilder builder, EdgeOptions options)
{
builder
.Register(_ => new RemoteWebDriver(new Uri(RemoteEndPoint), options.ToCapabilities(), TimeSpan.FromMinutes(5)))
.As<IWebDriver>()
.InstancePerLifetimeScope()
.OnActivated(x => x.Instance.FileDetector = new LocalFileDetector());
}
And we get this on the Node:
root#docker-desktop:/# java -jar standalone.jar node --allow-cors --publish-events tcp://192.168.50.16:4442 --subscribe-events tcp://192.168.50.16:4443 --config nodeConfig.json --allow-cors
02:24:11.283 INFO [LoggingOptions.getTracer] - Using OpenTelemetry for tracing
02:24:11.285 INFO [LoggingOptions.createTracer] - Using OpenTelemetry for tracing
02:24:11.323 INFO [EventBusOptions.createBus] - Creating event bus: org.openqa.selenium.events.zeromq.ZeroMqEventBus
02:24:11.374 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://192.168.50.16:4442 and tcp://192.168.50.16:4443
02:24:11.427 INFO [UnboundZmqEventBus.<init>] - Sockets created
02:24:11.454 INFO [UnboundZmqEventBus.lambda$new$2] - Bus started
02:24:11.776 INFO [NodeServer.execute] - Reporting self as: http://192.168.65.3:5555
02:24:11.860 INFO [NodeOptions.report] - Adding Edge for {"browserName": "MicrosoftEdge"} 2 times
02:24:12.094 INFO [NodeServer.execute] - Started Selenium node 4.0.0-alpha-6 (revision 5f43a29cfc): http://192.168.65.3:5555
02:24:12.100 INFO [NodeServer.execute] - Starting registration process for node id e5e8efd9-e217-4967-8cfe-e312e7565523
02:24:12.398 INFO [NodeServer.lambda$execute$0] - Node has been added
Starting MSEdgeDriver 88.0.692.0 (dcff1d910f6557f2cce9c685f757a5891423af0c) on port 21256
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping MSEdgeDriver safe.
MSEdgeDriver was started successfully.
Starting MSEdgeDriver 88.0.692.0 (dcff1d910f6557f2cce9c685f757a5891423af0c) on port 11003
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping MSEdgeDriver safe.
MSEdgeDriver was started successfully.
Starting MSEdgeDriver 88.0.692.0 (dcff1d910f6557f2cce9c685f757a5891423af0c) on port 24739
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping MSEdgeDriver safe.
MSEdgeDriver was started successfully.
Starting MSEdgeDriver 88.0.692.0 (dcff1d910f6557f2cce9c685f757a5891423af0c) on port 16505
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping MSEdgeDriver safe.
MSEdgeDriver was started successfully.
And this on the hub side:
02:24:32.050 WARN [SpanWrappedHttpHandler.execute] - Unable to execute request: Unable to create session for <CreateSessionRequest with Capabilities {browserName: MicrosoftEdge, ms:edgeChromium: true, ms:edgeOptions: {args: [--no-sandbox, --ignore-certificate-errors, --disable-dev-shm-usage, --ignore-urlfetcher-cert-re..., --lang=ja], prefs: {download.default_directory: C:\Users\nicolae.farcas\Des...}}}>
Build info: version: '4.0.0-alpha-7', revision: '117b9d61c9'
System info: host: '836e92c76b1f', ip: '172.17.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.184-linuxkit', java.version: '1.8.0_265'
Driver info: driver.version: unknown
org.openqa.selenium.SessionNotCreatedException: Unable to create session for <CreateSessionRequest with Capabilities {browserName: MicrosoftEdge, ms:edgeChromium: true, ms:edgeOptions: {args: [--no-sandbox, --ignore-certificate-errors, --disable-dev-shm-usage, --ignore-urlfetcher-cert-re..., --lang=ja], prefs: {download.default_directory: C:\Users\nicolae.farcas\Des...}}}>
Build info: version: '4.0.0-alpha-7', revision: '117b9d61c9'
System info: host: '836e92c76b1f', ip: '172.17.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.184-linuxkit', java.version: '1.8.0_265'
Driver info: driver.version: unknown
at org.openqa.selenium.grid.distributor.model.Slot.lambda$onReserve$1(Slot.java:86)
at java.util.Optional.orElseThrow(Optional.java:290)
at org.openqa.selenium.grid.distributor.model.Slot.lambda$onReserve$2(Slot.java:85)
at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:208)
at org.openqa.selenium.grid.distributor.Distributor.lambda$new$0(Distributor.java:89)
at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:183)
at org.openqa.selenium.remote.http.Route.execute(Route.java:67)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)
at org.openqa.selenium.remote.http.Route.execute(Route.java:67)
at org.openqa.selenium.grid.distributor.Distributor.execute(Distributor.java:124)
at org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:86)
at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)
at org.openqa.selenium.remote.http.Route.execute(Route.java:67)
at org.openqa.selenium.grid.router.Router.execute(Router.java:85)
at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)
at org.openqa.selenium.remote.http.Route.execute(Route.java:67)
at org.openqa.selenium.grid.server.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:30)
at org.openqa.selenium.grid.server.WrapExceptions.lambda$apply$0(WrapExceptions.java:36)
at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)
at org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:46)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
02:24:32.051 WARN [LoggingOptions$1.lambda$export$1] - {"traceId": "66e211f62bb44e6b57383c938386aa63","spanId": "d0836ebcedb75323","spanKind": "INTERNAL","eventTime": 1605666272050023400,"eventName": "exception","attributes": {"exception.type": "org.openqa.selenium.SessionNotCreatedException","exception.message": "Unable to execute request: Unable to create session for \u003cCreateSessionRequest with Capabilities {browserName: MicrosoftEdge, ms:edgeChromium: true, ms:edgeOptions: {args: [--no-sandbox, --ignore-certificate-errors, --disable-dev-shm-usage, --ignore-urlfetcher-cert-re..., --lang=ja], prefs: {download.default_directory: C:\\Users\\nicolae.farcas\\Des...}}}>\nBuild info: version: '4.0.0-alpha-7', revision: '117b9d61c9'\nSystem info: host: '836e92c76b1f', ip: '172.17.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.184-linuxkit', java.version: '1.8.0_265'\nDriver info: driver.version: unknown","http.handler_class": "org.openqa.selenium.grid.distributor.local.LocalDistributor","http.url": "\u002fsession","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Unable to create session for \u003cCreateSessionRequest with Capabilities {browserName: MicrosoftEdge, ms:edgeChromium: true, ms:edgeOptions: {args: [--no-sandbox, --ignore-certificate-errors, --disable-dev-shm-usage, --ignore-urlfetcher-cert-re..., --lang=ja], prefs: {download.default_directory: C:\\Users\\nicolae.farcas\\Des...}}}>\nBuild info: version: '4.0.0-alpha-7', revision: '117b9d61c9'\nSystem info: host: '836e92c76b1f', ip: '172.17.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.184-linuxkit', java.version: '1.8.0_265'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.distributor.model.Slot.lambda$onReserve$1(Slot.java:86)\n\tat java.util.Optional.orElseThrow(Optional.java:290)\n\tat org.openqa.selenium.grid.distributor.model.Slot.lambda$onReserve$2(Slot.java:85)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:208)\n\tat org.openqa.selenium.grid.distributor.Distributor.lambda$new$0(Distributor.java:89)\n\tat org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:183)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:67)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:67)\n\tat org.openqa.selenium.grid.distributor.Distributor.execute(Distributor.java:124)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:86)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:67)\n\tat org.openqa.selenium.grid.router.Router.execute(Router.java:85)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:67)\n\tat org.openqa.selenium.grid.server.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:30)\n\tat org.openqa.selenium.grid.server.WrapExceptions.lambda$apply$0(WrapExceptions.java:36)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:46)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n","http.method": "POST"}}
And the nodeConfig.json:
{
"capabilities":
[
{
"browserName": "MicrosoftEdge",
"maxInstances": 5,
"seleniumProtocol": "WebDriver",
"version": "88.0.692.0",
"applicationName": "Edge Node",
"webdriver.edge.driver": "msedgedriver",
"ms:edgeChromium": true
}
],
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 20,
"port": -1,
"register": true,
"registerCycle": 5000,
"hub": "http://192.168.50.16:4444",
"nodeStatusCheckTimeout": 5000,
"nodePolling": 5000,
"unregisterIfStillDownAfter": 60000,
"downPollingLimit": 5,
"debug": false,
"servlets" : [],
"withoutServlets": [],
"custom": {}
}
Test output:
System.InvalidOperationException
Unable to create session for <CreateSessionRequest with Capabilities {browserName: MicrosoftEdge, ms:edgeChromium: true, ms:edgeOptions: {args: [--no-sandbox, --ignore-certificate-errors, --disable-dev-shm-usage, --ignore-urlfetcher-cert-re..., --lang=ja], prefs: {download.default_directory: C:\Users\nicolae.farcas\Des...}}}>
Build info: version: '4.0.0-alpha-7', revision: '117b9d61c9'
System info: host: '836e92c76b1f', ip: '172.17.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.184-linuxkit', java.version: '1.8.0_265'
Driver info: driver.version: unknown (SessionNotCreated)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout)
EDIT 1:
When trying to run selenium alpha-7 as a node, i get this:
root#docker-desktop:/# java -jar standalone-4.0-alpha-7.jar node --allow-cors --publish-events tcp://192.168.50.16:4442 --subscribe-events tcp://192.168.50.16:4443 --config nodeConfig.json
15:26:00.250 INFO [LogManager$RootLogger.log] - Using the system default encoding
15:26:00.253 INFO [LoggingOptions.getTracer] - Using OpenTelemetry for tracing
15:26:00.253 INFO [LoggingOptions.createTracer] - Using OpenTelemetry for tracing
15:26:00.319 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://192.168.50.16:4442 and tcp://192.168.50.16:4443
15:26:00.358 INFO [UnboundZmqEventBus.<init>] - Sockets created
15:26:00.360 INFO [UnboundZmqEventBus.lambda$new$7] - Bus started
15:26:00.576 INFO [NodeServer.createHandlers] - Reporting self as: http://192.168.65.3:5555
15:26:00.581 INFO [LoggingOptions.getTracer] - Using OpenTelemetry for tracing
15:26:00.583 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://192.168.50.16:4442 and tcp://192.168.50.16:4443
15:26:00.585 INFO [UnboundZmqEventBus.<init>] - Sockets created
15:26:00.586 INFO [UnboundZmqEventBus.lambda$new$7] - Bus started
Exception in thread "main" java.lang.IllegalArgumentException: Unable to find class: org.openqa.selenium.grid.node.local.LocalNodeFactory
at org.openqa.selenium.grid.config.Config.getClass(Config.java:74)
at org.openqa.selenium.grid.config.MemoizedConfig.lambda$getClass$4(MemoizedConfig.java:99)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1688)
at org.openqa.selenium.grid.config.MemoizedConfig.getClass(MemoizedConfig.java:95)
at org.openqa.selenium.grid.node.config.NodeOptions.getNode(NodeOptions.java:74)
at org.openqa.selenium.grid.node.httpd.NodeServer.createHandlers(NodeServer.java:122)
at org.openqa.selenium.grid.node.httpd.NodeServer.asServer(NodeServer.java:176)
at org.openqa.selenium.grid.node.httpd.NodeServer.execute(NodeServer.java:217)
at org.openqa.selenium.grid.TemplateGridCommand.lambda$configure$2(TemplateGridCommand.java:98)
at org.openqa.selenium.grid.Main.launch(Main.java:154)
at org.openqa.selenium.grid.Main.go(Main.java:88)
at org.openqa.selenium.grid.Main.main(Main.java:54)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.openqa.selenium.grid.config.Config.getClass(Config.java:69)
... 11 more
Caused by: java.lang.NoSuchMethodError: java.io.FileReader.<init>(Ljava/io/File;Ljava/nio/charset/Charset;)V
at org.openqa.selenium.net.LinuxEphemeralPortRangeDetector.getInstance(LinuxEphemeralPortRangeDetector.java:36)
at org.openqa.selenium.net.PortProber.<clinit>(PortProber.java:42)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:401)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:119)
at org.openqa.selenium.chrome.ChromeDriverInfo.isAvailable(ChromeDriverInfo.java:57)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
at org.openqa.selenium.grid.node.config.NodeOptions.discoverDrivers(NodeOptions.java:187)
at org.openqa.selenium.grid.node.config.NodeOptions.getSessionFactories(NodeOptions.java:84)
at org.openqa.selenium.grid.node.local.LocalNodeFactory.create(LocalNodeFactory.java:66)
... 16 more
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details.
SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions prior to 1.8.
SLF4J: Ignoring binding found at [jar:file:/standalone-4.0-alpha-7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#ignoredBindings for an explanation.
EDIT 2:
After updating to Java 11, the error from EDIT 1 is gone but I am still seeing issues running the tests. The grid at /status tells me it's up but when I try running tests I get this:
From the tests:
OpenQA.Selenium.WebDriverTimeoutException
Unauthorized access attempted to
Build info: version: '4.0.0-alpha-7', revision: '117b9d61c9'
System info: host: '836e92c76b1f', ip: '172.17.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.184-linuxkit', java.version: '1.8.0_265'
Driver info: driver.version: unknown
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout)
From the hub:
16:26:36.171 WARN [SpanWrappedHttpHandler.execute] - Unable to execute request: Unauthorized access attempted to
Build info: version: '4.0.0-alpha-7', revision: '117b9d61c9'
System info: host: '836e92c76b1f', ip: '172.17.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.184-linuxkit', java.version: '1.8.0_265'
Driver info: driver.version: unknown
org.openqa.selenium.WebDriverException: Unauthorized access attempted to
Build info: version: '4.0.0-alpha-7', revision: '117b9d61c9'
System info: host: '836e92c76b1f', ip: '172.17.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.184-linuxkit', java.version: '1.8.0_265'
Driver info: driver.version: unknown
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.grid.web.ErrorCodec.decode(ErrorCodec.java:141)
at org.openqa.selenium.grid.web.Values.get(Values.java:47)
at org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:114)
at org.openqa.selenium.grid.distributor.model.Slot.lambda$onReserve$2(Slot.java:84)
at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:208)
at org.openqa.selenium.grid.distributor.Distributor.lambda$new$0(Distributor.java:89)
at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:183)
at org.openqa.selenium.remote.http.Route.execute(Route.java:67)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)
at org.openqa.selenium.remote.http.Route.execute(Route.java:67)
at org.openqa.selenium.grid.distributor.Distributor.execute(Distributor.java:124)
at org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:86)
at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)
at org.openqa.selenium.remote.http.Route.execute(Route.java:67)
at org.openqa.selenium.grid.router.Router.execute(Router.java:85)
at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)
at org.openqa.selenium.remote.http.Route.execute(Route.java:67)
at org.openqa.selenium.grid.server.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:30)
at org.openqa.selenium.grid.server.WrapExceptions.lambda$apply$0(WrapExceptions.java:36)
at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)
at org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:46)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
16:26:36.172 WARN [LoggingOptions$1.lambda$export$1] - {"traceId": "6c98780410750ac145fcc0bcdc6075f1","spanId": "1a237f64fb417958","spanKind": "INTERNAL","eventTime": 1605716796170301100,"eventName": "exception","attributes": {"exception.type": "org.openqa.selenium.WebDriverException","exception.message": "Unable to execute request: Unauthorized access attempted to \nBuild info: version: '4.0.0-alpha-7', revision: '117b9d61c9'\nSystem info: host: '836e92c76b1f', ip: '172.17.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.184-linuxkit', java.version: '1.8.0_265'\nDriver info: driver.version: unknown","http.handler_class": "org.openqa.selenium.grid.distributor.local.LocalDistributor","http.url": "\u002fsession","exception.stacktrace": "org.openqa.selenium.WebDriverException: Unauthorized access attempted to \nBuild info: version: '4.0.0-alpha-7', revision: '117b9d61c9'\nSystem info: host: '836e92c76b1f', ip: '172.17.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.184-linuxkit', java.version: '1.8.0_265'\nDriver info: driver.version: unknown\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n\tat java.lang.reflect.Constructor.newInstance(Constructor.java:423)\n\tat org.openqa.selenium.grid.web.ErrorCodec.decode(ErrorCodec.java:141)\n\tat org.openqa.selenium.grid.web.Values.get(Values.java:47)\n\tat org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:114)\n\tat org.openqa.selenium.grid.distributor.model.Slot.lambda$onReserve$2(Slot.java:84)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:208)\n\tat org.openqa.selenium.grid.distributor.Distributor.lambda$new$0(Distributor.java:89)\n\tat org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:183)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:67)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:67)\n\tat org.openqa.selenium.grid.distributor.Distributor.execute(Distributor.java:124)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:86)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:67)\n\tat org.openqa.selenium.grid.router.Router.execute(Router.java:85)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:67)\n\tat org.openqa.selenium.grid.server.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:30)\n\tat org.openqa.selenium.grid.server.WrapExceptions.lambda$apply$0(WrapExceptions.java:36)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:46)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n","http.method": "POST"}}
From the node:
16:26:36.070 WARN [RequiresSecretFilter.isSecretMatch] - Unexpectedly received registration secret to (POST) /se/grid/node/session
16:26:36.078 WARN [LoggingOptions$1.lambda$export$0] - {"traceId": "7bd8f4e2a6a68f396b4d73d7ce41920e","spanId": "413eadfe028cb4f3","spanKind": "INTERNAL","eventTime": 1605716796076570700,"eventName": "HTTP request execution complete","attributes": {"http.status_code": 401,"http.handler_class": "org.openqa.selenium.grid.security.RequiresSecretFilter$$Lambda$356\u002f0x0000000840219040","http.url": "\u002fse\u002fgrid\u002fnode\u002fsession","http.method": "POST"}}
16:26:36.164 WARN [RequiresSecretFilter.isSecretMatch] - Unexpectedly received registration secret to (POST) /se/grid/node/session
16:26:36.165 WARN [LoggingOptions$1.lambda$export$0] - {"traceId": "c71c7cc95c85b1d892a913a8487a3bb3","spanId": "e7cad4724bde618f","spanKind": "INTERNAL","eventTime": 1605716796164917000,"eventName": "HTTP request execution complete","attributes": {"http.status_code": 401,"http.handler_class": "org.openqa.selenium.grid.security.RequiresSecretFilter$$Lambda$356\u002f0x0000000840219040","http.url": "\u002fse\u002fgrid\u002fnode\u002fsession","http.method": "POST"}}
16:26:45.135 INFO [LoggingOptions$1.lambda$export$0] - {"traceId": "f9aa30acdd23b666a00fd12d1e9171de","spanId": "3a26d851115e4ed8","spanKind": "INTERNAL","eventTime": 1605716805135500700,"eventName": "HTTP request execution complete","attributes": {"http.status_code": 200,"http.handler_class": "org.openqa.selenium.remote.http.Route$TemplatizedRoute","http.url": "\u002fstatus","http.method": "GET"}}
16:26:56.789 INFO [LoggingOptions$1.lambda$export$0] - {"traceId": "0be52be996fecb3cfeb4981cc69e4719","spanId": "034962023cad771b","spanKind": "INTERNAL","eventTime": 1605716816788987800,"eventName": "HTTP request execution complete","attributes": {"http.status_code": 200,"http.handler_class": "org.openqa.selenium.remote.http.Route$TemplatizedRoute","http.url": "\u002fstatus","http.method": "GET"}}
Remove:
"webdriver.edge.driver": "msedgedriver",
from capabilities, and add:
-Dwebdriver.edge.driver=/path/to/msedgedriver
to your node call. For example:
java -jar /path/to/selenium-standalone.jar -Dwebdriver.edge.driver=/path/to/msedgedriver -role node -nodeConfig /path/to/node-config.json
Ah, and your browserName must be MicrosoftEdge (you have it, but mentioning it for others reading this).
This worked for me for Selenium 3.

UI automation -- iOS press enter key

I am trying to automate pressing the ENTER key upon searching for a text
public void pressEnter() {
((IOSDriver) driver).getKeyboard().sendKeys(Keys.RETURN);
}
I'm getting this error when trying to automate pressing the Enter key. What's wrong here? This used to work. I also tried Keys.ENTER and it gave the same error.
java-client version: 6.0.0
org.openqa.selenium.UnsupportedCommandException: sendKeysToActiveElement
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'
System info: host: 'DESKTOP-JPLMVQR', ip: 'my.ip.address.here', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.4', java.version: '1.8.0_152-release'
Driver info: driver.version: IOSDriver
at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:218)
at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:117)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:152)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:218)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteExecuteMethod.execute(RemoteExecuteMethod.java:35)
at org.openqa.selenium.remote.RemoteKeyboard.sendKeys(RemoteKeyboard.java:38)
at com.example.base.BaseTest.pressEnter(BaseTest.java:98)
at com.example.tests.SearchTests.verifySearch_RedirectToDetail(SearchTests.java:97)
Use this code change as per your requirement instead of Done use Enter like this
IOSDriver< WebElement> AD= (IOSDriver) driver;
AD.hideKeyboard("PRESS_KEY", "Done");

How to safely update chromedriver on selenium nodes

I have a selenium grid setup with one hub and 5 nodes. they both use the same version of selenium server 2.41.0.
On the nodes there are already chromedriver setup in the same folder as selenium sever.
Now the task is to update the chromedriver without broken any existing jenkins tests.
I have tried manually go to each nodes and update the chromedriver file. But, the tests on jenkins will throw WebDriverException saying unable to create driver.
What could be the issue here?
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'dseleniumnode05.xxx-dev.com', ip: 'xx.xx.xx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.11.10-100.fc18.x86_64', java.version: '1.7.0_45'
Driver info: org.openqa.selenium.chrome.ChromeDriver
14:08:37.077 INFO - Executing: [new session: Capabilities [{platform=LINUX, browserName=chrome, proxy={socksUsername=null, noProxy=null, httpProxy=proxy.xxx-stage.com:80, socksPassword=null, ftpProxy=null, sslProxy=proxy.xxx-stage.com:443, proxyAutoconfigUrl=null, proxyType=MANUAL, class=org.openqa.selenium.Proxy, autodetect=false, hCode=1182650898, socksProxy=null}, version=, chrome.switches=[--start-maximized]}]] at URL: /session)
14:08:37.078 INFO - Creating a new session for Capabilities [{platform=LINUX, browserName=chrome, proxy={socksUsername=null, noProxy=null, httpProxy=proxy.xxx-stage.com:80, socksPassword=null, ftpProxy=null, sslProxy=proxy.xxx-stage.com:443, proxyAutoconfigUrl=null, proxyType=MANUAL, class=org.openqa.selenium.Proxy, autodetect=false, hCode=1182650898, socksProxy=null}, version=, chrome.switches=[--start-maximized]}]
Starting ChromeDriver (v2.10.267518) on port 13326
Only local connections are allowed.
[0.500][WARNING]: PAC support disabled because there is no system implementation
14:09:38.101 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'dseleniumnode05.xxx-dev.com', ip: 'xx.xx.xx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.11.10-100.fc18.x86_64', java.version: '1.7.0_45'
Driver info: driver.version: unknown
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:177)
at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:113)
at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:90)
at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:96)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:63)
at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:202)
at org.openqa.selenium.remote.server.JsonHttpRemoteConfig.handleRequest(JsonHttpRemoteConfig.java:193)
at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:174)
at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:140)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:112)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:680)
at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:571)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'dseleniumnode05.xxx-dev.com', ip: 'xx.xx.xx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.11.10-100.fc18.x86_64', java.version: '1.7.0_45'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:72)
at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:56)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:216)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:170)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:62)
... 8 more
Caused by: org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.10.267518,platform=Linux 3.11.10-100.fc18.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.52 seconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'dseleniumnode05.xxx-dev.com', ip: 'xx.xx.xx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.11.10-100.fc18.x86_64', java.version: '1.7.0_45'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.chrome.ChromeDriver.startSession(ChromeDriver.java:181)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:139)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:160)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:128)
... 13 more
14:09:38.103 WARN - Exception: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.10.267518,platform=Linux 3.11.10-100.fc18.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.52 seconds
the matter is that instance of driver is created on host machine (using existing chromdriver file there). Obviously once you substitute updated chrome driver file (of a newer version) older one -> everything should work fine after driver instance reinitizalization.
To initialize driver , I'm using following java piece of code:
public static WebDriver driverSetUp(WebDriver driver) throws MalformedURLException {
DesiredCapabilities capability = DesiredCapabilities.chrome();
log.info("Google chrome is selected");
System.setProperty("webdriver.chrome.driver", "....path/chromedriver.exe");
capability.setBrowserName("chrome");
capability.setPlatform(org.openqa.selenium.Platform.WINDOWS);
String webDriverURL = "http://" + environmentData.getHubIP() + ":" + environmentData.getHubPort() + "/wd/hub";
driver = new RemoteWebDriver(new URL(webDriverURL), capability);
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driver.manage().window().setSize(new Dimension(1920, 1080));
return driver;
}
Try it out and let us know whether issue persists. Thanks.

Not able to select value from dropdown experience(Exp.) field of Naukri.com

The following code is not working, and is throwing the error shown below:
WebDriver driver=new FirefoxDriver();
driver.get("http://www.naukri.com/");
driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
Select Exp_drpdwn = new Select(driver.findElement(By.id("expSL")));
Exp_drpdwn.selectByValue("2");
Error
Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with
Command duration or timeout: 100.05 seconds
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:12:12'
System info: host: 'ANUPAM-PC', ip: '192.168.1.39', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_45'
Session ID: 1c82f01f-2f60-43b6-8b70-ce139ee96508
Driver info: org.openqa.selenium.firefox.FirefoxDriver
The element you are trying to select is not visible. It becomes visible upon clicking on By.id("exp") node. So try clicking it before accessing the select:
driver.findElement(By.id("exp")).click();
Alternatively you can edit the value with JavaScript:
((JavascriptExecutor) driver).executeScript("document.getElementById('exp').value = 2");

JavascriptError while using Internet Explorer with WebDriverBackedSelenium

I am using WebDriverBackedSelenium for the automated testing of a website but my code is working fine for the chrome and firefox but problem in IE
Code is
WebDriver driver = new ChromeDriver();
String baseUrl = "https://mywebsite.com/";
selenium = new WebDriverBackedSelenium(driver, baseUrl);
selenium.fireEvent("//td[#id='skin_container_logoff']/a/table/tbody/tr/td[2]", "click");
This line give the below error
com.thoughtworks.selenium.SeleniumException: JavaScript error (WARNING: The server did not
provide any stacktrace information) Command duration or timeout: 125 milliseconds Build info:
version: '2.18.0', revision: '15704', time: '2012-01-27 15:48:16' System info: os.name: '
Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_24' Driver info:
driver.version: EventFiringWebDriver Command duration or timeout: 735 milliseconds Build info:
version: '2.18.0', revision: '15704', time: '2012-01-27 15:49:22' System info: os.name:
'Linux', os.arch: 'amd64', os.version: '2.6.32-131.2.1.el6.x86_64', java.version: '1.6.0_26-
rev' Driver info: driver.version: RemoteWebDriver at
org.openqa.selenium.internal.seleniumemulation.SeleneseCommand.apply(SeleneseCommand.java:42)
at org.openqa.selenium.internal.seleniumemulation.Timer.run(Timer.java:39) at
org.openqa.selenium.WebDriverCommandProcessor.execute(WebDriverCommandProcessor.java:145) at
org.openqa.selenium.WebDriverCommandProcessor.doCommand(WebDriverCommandProcessor.java:75) at
com.thoughtworks.selenium.DefaultSelenium.fireEvent(DefaultSelenium.java:210) at
com.example.tests.WebDriverBackedSeleniumEx.fireEvent(WebDriverBackedSeleniumEx.java:103) at
com.example.tests.LoginAdvanceIE.testLoginIE(LoginAdvanceIE.java:48) at
com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:230) Caused by:
org.openqa.selenium.WebDriverException: JavaScript error (WARNING: The server did not provide
any stacktrace information) Command duration or timeout: 125 milliseconds Build info: version:
'2.18.0', revision: '15704', time: '2012-01-27 15:48:16' System info: os.name: 'Windows 7',
os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_24' Driver info: driver.version:
EventFiringWebDriver Command duration or timeout: 735 milliseconds Build info: version:
'2.18.0', revision: '15704', time: '2012-01-27 15:49:22' System info: os.name: 'Linux', os.arch:
'amd64', os.version: '2.6.32-131.2.1.el6.x86_64', java.version: '1.6.0_26-rev' Driver info:
driver.version: RemoteWebDriver at
java.lang.reflect.Constructor.newInstance(Constructor.java:513) at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:147) at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:113) at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:439) at
org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:353) at
org.openqa.selenium.internal.seleniumemulation.JavascriptLibrary.executeScript(JavascriptLibrary.java
:88) at
org.openqa.selenium.internal.seleniumemulation.FireEvent.handleSeleneseCommand(FireEvent.java:38)
at
org.openqa.selenium.internal.seleniumemulation.FireEvent.handleSeleneseCommand(FireEvent.java:1)
at org.openqa.selenium.internal.seleniumemulation.SeleneseCommand.apply(SeleneseCommand.java:36)
Caused by: org.openqa.selenium.remote.ScreenshotException: Screen shot has been taken Build info:
version: '2.18.0', revision: '15704', time: '2012-01-27 15:49:22' System info: os.name: 'Linux',
os.arch: 'amd64', os.version: '2.6.32-131.2.1.el6.x86_64', java.version: '1.6.0_26-rev' Driver
info: driver.version: RemoteWebDriver at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:101) Caused by:
org.openqa.selenium.WebDriverException: JavaScript error (WARNING: The server did not provide any
stacktrace information) Command duration or timeout: 125 milliseconds Build info: version:
'2.18.0', revision: '15704', time: '2012-01-27 15:48:16' System info: os.name: 'Windows 7',
os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_24' Driver info: driver.version: Even
tFiringWebDriver Build info: version: '2.18.0', revision: '15704', time: '2012-01-27 15:49:22'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-131.2.1.el6.x86_64',
java.version: '1.6.0_26-rev' Driver info: driver.version: EventFiringWebDriver at
java.lang.reflect.Constructor.newInstance(Unknown Source) at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:147) at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:113) at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:439) at
org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:353) at
org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(EventFiringWebDriver.java:100) at
$Proxy2.executeScript(Unknown Source) at
org.openqa.selenium.support.events.EventFiringWebDriver.executeScript(EventFiringWebDriver.java:208)
at org.openqa.selenium.remote.server.handler.ExecuteScript.call(ExecuteScript.java:54) at
org.openqa.selenium.remote.server.handler.ExecuteScript.call(ExecuteScript.java:1) at
java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at
java.util.concurrent.FutureTask.run(Unknown Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown
Source)
I tried the WebDriverWait but I am still getting the error.
I am not sure if this is the problem, but try specifying javascript timeout manually:
driver.manage().timeouts().setScriptTimeout(30, TimeUnit.SECONDS);