Not able to run selenium test jar in ec2 - selenium

I am new to selenium and by help of some blogs and videos and i made a java selenium test in eclipse which is running perfectly fine, but my goal is to run the file on an ec2. I exported the jar and tried to run it on a ubuntu VM, but it is not running and giving the error as mentioned below. Any help would be appreciated.
Microsoft Edge WebDriver was started successfully.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: chrome not reachable
Host info: host: 'ip-192-168-2-75', ip: '192.168.2.75'
Build info: version: '4.7.1', revision: 'c6795baf1a3'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.0-1027-aws', java.version: '11.0.17'
Driver info: org.openqa.selenium.edge.EdgeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: MicrosoftEdge, ms:edgeOptions: {args: [], extensions: []}}], desiredCapabilities=Capabilities {browserName: MicrosoftEdge, ms:edgeOptions: {args: [], extensions: []}}}]
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:148)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:106)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:167)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:551)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:244)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:159)
at org.openqa.selenium.chromium.ChromiumDriver.(ChromiumDriver.java:101)
at org.openqa.selenium.edge.EdgeDriver.(EdgeDriver.java:54)
at org.openqa.selenium.edge.EdgeDriver.(EdgeDriver.java:46)
at org.openqa.selenium.edge.EdgeDriver.(EdgeDriver.java:42)
at ui.SureSMSTest.main(SureSMSTest.java:36)

Related

Unable to connect to a remote machine using RemoteWebdriver

As i am new to selenium WebDriver, Remote Webdriver and WebDriverManager, i have issues connecting from hub to the node. This is how my design looks like -
I have a code base which runs on linux based machines. Now, I go ahead and git clone the selenium repository on linux machine . I would want to establish that linux machine as a hub. So start the selenium Standalone server on the linux machine as below -
java -jar selenium-server-standalone-3.5.3.jar -role hub
Now i have Windows based machines which i communicate using Remote Desktop Connection application
and i consider them as nodes and on one of the windows based machine i start the selenium standalone server as a node like below -
java -jar selenium-server-standalone-3.5.3.jar -role node -hub http://<public ip of linux hub machine>:4444/grid/register/
For both i get the successful connection
Linux Machine -
Windows Machine -
I try to execute below code -
#Test
public void test() throws MalformedURLException
{
System.out.println("Sample Test");
String s1 = System.getProperty("user");
String s2 = System.getProperty("pass");
System.out.println(s1);
System.out.println(s2);
System.out.println("++++++++++++++++++SETTING UP OPTIONS+++++++++++++");
//FirefoxOptions options = new FirefoxOptions();
ChromeOptions options = new ChromeOptions();
options.addArguments("--allow-insecure-localhost");
options.addArguments("--start-maximized");
options.addArguments("--no-sandbox");
options.addArguments("--ignore-certificate-errors");
options.addArguments("--allow-running-insecure-content");
options.setAcceptInsecureCerts(true);
WebDriver driver = new RemoteWebDriver(new URL("http://<IP_LINUXMACHINE>:4444/wd/hub"),options);
System.out.println("++++++++++++++++++SETTING UP WEBDRIVER +++++++++++++++++++++++++++");
//WebDriver driver = WebDriverManager.chromedriver().capabilities(options).remoteAddress("http://<IP_LINUXMACHINE:4444/wd/hub").create();
driver.get("https://google.com");
}
Below is the MVN command -
mvn -f pom.xml -pl FrontEndTestsRepo,SharedLibrariesRepo --am clean install test -DsuiteXmlFile=testsuite.xml -Duser=abc -Dpass=abc#12
I get below error -
brotli4j not in the classpath; Brotli support will be unavailable.
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.31 sec <<< FAILURE! - in TestSuite
test(com.******.mc.tests.common.LoginTests) Time elapsed: 1.225 sec <<< FAILURE!
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Unable to create new service: ChromeDriverService
Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:54:15.039Z'
System info: host: 'JENKINS-WIN-S12', ip: '************', os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_321'
Driver info: driver.version: unknown
Build info: version: '4.1.2', revision: '9a5a329c5a'
System info: host: 'uiUbuntu18-102-44-LinuxSlave', ip: '********', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-42-generic', java.version: '1.8.0_292'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--allow-insecure-localhost, --start-maximized, --no-sandbox, --ignore-certificate-errors, --allow-running-insecure-co...], extensions: []}}], desiredCapabilities=Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--allow-insecure-localhost, --start-maximized, --no-sandbox, --ignore-certificate-errors, --allow-running-insecure-co...], extensions: []}}}]
Capabilities {}
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
at org.openqa.selenium.remote.TracedCommandExecutor.execute(TracedCommandExecutor.java:51)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:558)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:245)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:161)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:143)
at com.*******.mc.tests.common.LoginTests.test(LoginTests.java:47)
Got below error on hub
Got a request to create a new session: Capabilities [{goog:chromeOptions={args=[--allow-insecure-localhost, --start-maximized, --no-sandbox, --ignore-certificate-errors, --allow-running-insecure-content], extensions=[]}, acceptInsecureCerts=true, browserName=chrome}]
11:48:59.308 INFO - Trying to create a new session on test slot {seleniumProtocol=WebDriver, browserName=chrome, maxInstances=5, platform=VISTA}

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.

Getting "org.openqa.selenium.WebDriverException: Error forwarding the new session Error forwarding the request Connect to" connecting hub with node

OS: Linux
Selenium Version:**3.12
**Browser: Chrome V66,
chromedriver 2.38
Following is my Grid configuration:
Hub(Linux) runs on Jenkins machine(https://jenkins.us.abc.edu) with Selenium Grid Jenkins plugin.
Now i am trying to register my Node with json like below and starting Node:
java -jar -Dwebdriver.chrome.driver=chromedriver selenium-rver-standalone-3.12.0.jar -role node -nodeConfig node.json
node.json
{
"capabilities":
[
{
"browserName": "firefox",
"maxInstances": 5,
"seleniumProtocol": "WebDriver"
},
{
"browserName": "chrome",
"maxInstances": 5,
"seleniumProtocol": "WebDriver"
},
{
"browserName": "internet explorer",
"maxInstances": 1,
"seleniumProtocol": "WebDriver"
}
],
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 5,
**"port": 17946,**
"register": true,
"registerCycle": 5000,
**"hub": "http://jenkins.us.abc.edu:4444",**
"nodeStatusCheckTimeout": 5000,
"nodePolling": 5000,
"role": "node",
"unregisterIfStillDownAfter": 60000,
"downPollingLimit": 2,
"debug": false,
"servlets" : [],
"withoutServlets": [],
"custom": {}
}
Following is Node console:
[uanem#usv-selapp-01 ~]$ java -jar -Dwebdriver.chrome.driver=chromedriver selenium-rver-standalone-3.12.0.jar -role node -nodeConfig node.json
09:37:49.054 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.12.0', revision: '7c6e0b3'
09:37:49.059 INFO [GridLauncherV3$3.launch] - Launching a Selenium Grid node on port 17946
2018-05-28 09:37:49.175:INFO::main: Logging initialized #490ms to org.seleniumhq.jetty9.util.log.StdErrLog
09:37:49.324 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 17946
09:37:49.324 INFO [GridLauncherV3$3.launch] - Selenium Grid node is up and ready to register to the hub
09:37:49.332 INFO [SelfRegisteringRemote$1.run] - Starting auto registration thread. Will try to register every 5000 ms.
09:37:49.332 INFO [SelfRegisteringRemote.registerToHub] - Registering the node to the hub: http://jenkins.us.umuc.edu:4444/grid/register
09:37:50.866 INFO [SelfRegisteringRemote.registerToHub] - Updating the node configuration from the hub
09:37:50.965 WARN [SelfRegisteringRemote.registerToHub] - error getting the parameters from the hub. The node may end up with wrong timeouts.hudson.plugins.selenium.JenkinsCapabilityMatcher could not be coerced to instance
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z'
System info: host: 'usv-selapp-01.us.umuc.edu', ip: '10.190.33.90', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-862.el7.x86_64', java.version: '1.8.0_144'
Driver info: driver.version: unknown
09:37:50.965 INFO [SelfRegisteringRemote.registerToHub] - The node is registered to the hub and ready to use
09:39:11.333 INFO [SelfRegisteringRemote.registerToHub] - Registering the node to the hub: http://jenkins.us.umuc.edu:4444/grid/register
09:39:11.392 INFO [SelfRegisteringRemote.registerToHub] - Updating the node configuration from the hub
09:39:11.404 WARN [SelfRegisteringRemote.registerToHub] - error getting the parameters from the hub. The node may end up with wrong timeouts.hudson.plugins.selenium.JenkinsCapabilityMatcher could not be coerced to instance
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z'
System info: host: 'usv-selapp-01.us.umuc.edu', ip: '10.190.33.90', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-862.el7.x86_64', java.version: '1.8.0_144'
Driver info: driver.version: unknown
09:39:11.405 INFO [SelfRegisteringRemote.registerToHub] - The node is registered to the hub and ready to use
09:40:31.602 INFO [SelfRegisteringRemote.registerToHub] - Registering the node to the hub: http://jenkins.us.umuc.edu:4444/grid/register
09:40:31.632 INFO [SelfRegisteringRemote.registerToHub] - Updating the node configuration from the hub
09:40:31.642 WARN [SelfRegisteringRemote.registerToHub] - error getting the parameters from the hub. The node may end up with wrong timeouts.hudson.plugins.selenium.JenkinsCapabilityMatcher could not be coerced to instance
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z'
System info: host: 'usv-selapp-01.us.umuc.edu', ip: '10.190.33.90', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-862.el7.x86_64', java.version: '1.8.0_144'
Driver info: driver.version: unknown
09:40:31.642 INFO [SelfRegisteringRemote.registerToHub] - The node is registered to the hub and ready to use
09:41:51.809 INFO [SelfRegisteringRemote.registerToHub] - Registering the node to the hub: http://jenkins.us.umuc.edu:4444/grid/register
09:41:51.850 INFO [SelfRegisteringRemote.registerToHub] - Updating the node configuration from the hub
09:41:51.856 WARN [SelfRegisteringRemote.registerToHub] - error getting the parameters from the hub. The node may end up with wrong timeouts.hudson.plugins.selenium.JenkinsCapabilityMatcher could not be coerced to instance
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z'
System info: host: 'usv-selapp-01.us.umuc.edu', ip: '10.190.33.90', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-862.el7.x86_64', java.version: '1.8.0_144'
Driver info: driver.version: unknown
09:41:51.856 INFO [SelfRegisteringRemote.registerToHub] - The node is registered to the hub and ready to use
Here i could see the node is connected hub in my Jenkins Selenium Grid page at "10.190.33.90"
Following is my sample script:
#Test
public void GoogleTest() throws Exception
{
System.out.println("I am in test");
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
System.out.println("I am after setting chromedriver path ");
**remoteWD = new RemoteWebDriver(new URL("http://usv-bmsapp-01.us.abc.edu:4444/wd/hub"), capabilities);**
**//remoteWD = new RemoteWebDriver(new URL("https://jenkins.us.abc.edu:4444/wd/hub"), capabilities);**
//remoteWD = new ChromeDriver();
System.out.println("I am after RMD");
remoteWD.get("http://www.google.com");
WebElement element = remoteWD.findElement(By.name("q"));
element.sendKeys("Selenium WebDriver");
element.submit();
Thread.sleep(10000);
System.out.println(remoteWD.getTitle());
remoteWD.quit();
}
Due to security reasons or whatever i am not able to connect "https://jenkins.us.abc.edu:4444/wd/hub", but when i give the server name like this "http://usv-bmsapp-01.us.abc.edu:4444/wd/hub" I am able to connect.
Following is the error message i am getting. Can someone help me where i am going wrong???
Running gridtest.GridTest
Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator#7dc5e7b4
I am before test
I am in test
I am after setting chromedriver path
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 95.6 sec <<< FAILURE!
GoogleTest(gridtest.GridTest) Time elapsed: 94.334 sec <<< FAILURE!
org.openqa.selenium.WebDriverException: Error forwarding the new session Error forwarding the request Connect to 10.190.33.90:17946 [/10.190.33.90] failed: Connection timed out
Command duration or timeout: 92.06 seconds
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.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$24(ProtocolHandshake.java:359)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:362)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:136)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:586)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:217)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:140)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:153)
at gridtest.GridTest.GoogleTest(GridTest.java:49)
Caused by: org.openqa.selenium.WebDriverException: Error forwarding the new session Error forwarding the request Connect to 10.190.33.90:17946 [/10.190.33.90] failed: Connection timed out
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
System info: host: 'usv-bmsapp-01.us.umuc.edu', ip: '10.190.32.186', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-696.23.1.el6.x86_64', java.version: '1.8.0_77'
Driver info: driver.version: unknown
at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:117)
at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:84)
at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:841)
at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.seleniumhq.jetty9.server.Server.handle(Server.java:564)
at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:317)
at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:110)
at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred(Invocable.java:128)
at org.seleniumhq.jetty9.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
at java.lang.Thread.run(Thread.java:745)
There seems to be a couple of issues which you ned to address as follows:
Selenium version
Logs in Node depicts:
Selenium version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z'
Logs in Console depicts:
Selenium version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
JDK version
Logs in Node depicts:
java.version '1.8.0_144'
Logs in Console depicts:
java.version '1.8.0_77'
Node startup command
The command which you have used to register the node looks error-pront as follows:
java -jar -Dwebdriver.chrome.driver=chromedriver selenium-rver-standalone-3.12.0.jar -role node -nodeConfig node.json
It should have been:
java -jar -Dwebdriver.chrome.driver=chromedriver selenium-server-standalone-3.12.0.jar -role node -nodeConfig node.json
Solution
Upgrade JDK in Selenium Grid Hub and Selenium Grid Node to recent levels JDK 8u171.
Upgrade Selenium Client in Selenium Grid Hub and _Selenium Grid Node_to current levels Version 3.12.0.
Upgrade ChromeDriver to current ChromeDriver v2.38 level.
Keep Chrome version at Chrome v66.x levels. (as per ChromeDriver v2.38 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test.
Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
nodeConfig
To start simple you can reduce the nodeConfig i.e. node.json as follows:
{
"capabilities": [
{
"browserName": "firefox",
"maxInstances": 5,
"seleniumProtocol": "WebDriver"
},
{
"browserName": "chrome",
"maxInstances": 5,
"seleniumProtocol": "WebDriver"
},
{
"browserName": "internet explorer",
"maxInstances": 1,
"seleniumProtocol": "WebDriver"
}
],
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 5,
"port": 5566,
"host": ip,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": jenkins.us.abc.edu,
"timeout":120,
"browserTimeout":60
}

Protractor not working for Safari on windows 7

I am trying to run protractor e2e test cases on safari with windows 7. its throwing following error:
[10:27:59] I/local - Starting selenium standalone server...
[10:27:59] I/launcher - Running 1 instances of WebDriver
[10:28:00] I/local - Selenium standalone server started at http://10.1.69.133:65294/wd/hub
[10:28:01] E/launcher - The best matching driver provider org.openqa.selenium.edge.EdgeDriver can't create a new driver instance for Capabilities [{
ceptSslCerts=true, trustAllSSLCertificates=true, name=safari-tests, count=1, browserName=safari, directConnect=false, sharedTestFiles=true}]
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'DENXD7OShore41p', ip: '10.1.69.133', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_112'
Driver info: driver.version: unknown
[10:28:01] E/launcher - WebDriverError: The best matching driver provider org.openqa.selenium.edge.EdgeDriver can't create a new driver instance for
apabilities [{acceptSslCerts=true, trustAllSSLCertificates=true, name=safari-tests, count=1, browserName=safari, directConnect=false, sharedTestFile
true}]
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'DENXD7OShore41p', ip: '10.1.69.133', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_112'
Driver info: driver.version: unknown
at WebDriverError (c:\Git\operator\ui\node_modules\selenium-webdriver\lib\error.js:27:5)
at Object.checkLegacyResponse (c:\Git\operator\ui\node_modules\selenium-webdriver\lib\error.js:639:15)
at parseHttpResponse (c:\Git\operator\ui\node_modules\selenium-webdriver\http\index.js:538:13)
at client_.send.then.response (c:\Git\operator\ui\node_modules\selenium-webdriver\http\index.js:472:11)
at ManagedPromise.invokeCallback_ (c:\Git\operator\ui\node_modules\selenium-webdriver\lib\promise.js:1379:14)
at TaskQueue.execute_ (c:\Git\operator\ui\node_modules\selenium-webdriver\lib\promise.js:2913:14)
at TaskQueue.executeNext_ (c:\Git\operator\ui\node_modules\selenium-webdriver\lib\promise.js:2896:21)
at asyncRun (c:\Git\operator\ui\node_modules\selenium-webdriver\lib\promise.js:2820:25)
at c:\Git\operator\ui\node_modules\selenium-webdriver\lib\promise.js:639:7
at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.createSession()
at Function.createSession (c:\Git\operator\ui\node_modules\selenium-webdriver\lib\webdriver.js:329:24)
at Builder.build (c:\Git\operator\ui\node_modules\selenium-webdriver\builder.js:458:24)
at Local.DriverProvider.getNewDriver (c:\Git\operator\ui\node_modules\protractor\built\driverProviders\driverProvider.js:37:33)
at Runner.createBrowser (c:\Git\operator\ui\node_modules\protractor\built\runner.js:198:43)
at c:\Git\operator\ui\node_modules\protractor\built\runner.js:277:30
at _fulfilled (c:\Git\operator\ui\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (c:\Git\operator\ui\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (c:\Git\operator\ui\node_modules\q\q.js:796:13)
at c:\Git\operator\ui\node_modules\q\q.js:604:44
at runSingle (c:\Git\operator\ui\node_modules\q\q.js:137:13)
[10:28:01] E/launcher - Process exited with error code 199
Here is the code for my protractor.conf.js file. I made some changes in config after error, Like i added selenium address and removed acceptSslCerts=true, trustAllSSLCertificates=true but after that i am getting the same error.
/*global jasmine */
var SpecReporter = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'safari',
name: 'safari-tests',
directConnect: false,
seleniumAddress: 'http://localhost:4444/wd/hub'
},
maxInstances: 1,
baseUrl: 'http://localhost:3000/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 300000,
isVerbose : true,
includeStackTrace : true,
print: function() {}
},
useAllAngular2AppRoots: true,
onPrepare: function() {
require('ts-node').register({
project: 'e2e'
});
jasmine.getEnv().addReporter(new SpecReporter());
browser.ignoreSynchronization = true;
}
};
Does it require some other configuration to run it on Safari.
Safari for Windows was discontinued years ago and installing the old Safari 5 exe that's still around won't help you achieve anything useful regarding test automation.
So never download Safari from other that the official site else chances are you are getting a Trojan in it.
You can only test Safari using a Mac OSX or you can try Sauce Labs / BrowserStack / Testing Bot / other cloud test providers to test in browsers you don't have installed locally.

Unable to launch firefox with selenium grid 3.0.1 gecko driver 0.11.1 firefox 50.0.1

Trying to launch firefox with selenium grid is through exception as below:
org.openqa.selenium.sessionnotcreatedexception
Code I am using is as below:
if(useRemoteWebDriver){
URL seleniumGridURL = new URL(System.getProperty("gridURL"));
String desiredBrowserVersion = System.getProperty("desiredBrowserVersion");
String desiredPlatform = System.getProperty("desiredPlatform");
if (!desiredPlatform.isEmpty())
if ((null != desiredPlatform)) {
desiredCapabilities.setPlatform(Platform.valueOf(desiredPlatform.toUpperCase()));
}
if (null != desiredBrowserVersion && !desiredBrowserVersion.isEmpty()){
desiredCapabilities.setVersion(desiredBrowserVersion);
}
webDriver = new RemoteWebDriver(seleniumGridURL, desiredCapabilities);
}else{
webDriver = selectedDriverType.getWebDriverObject(desiredCapabilities);
}
and I am trying to run it from command line using
mvn clean install -Dremote=true -DseleniumGridURL=http://localhost:5555/wd/hub -Dbrowser=firefox -Dwebdriver.gecko.driver="E:\GeckoDriver\geckodriver.exe" -DbrowserVersion="50.0.1"
this is giving me the following exception
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, binary=C:\Program Files (x86)\Mozilla Firefox\firefox.exe, browserName=firefox, version=50.0.1, platform=ANY}], required capabilities = Capabilities [{}]
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'
System info: host: 'exipc0006', ip: '172.16.12.123', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_111'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:91)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:155)
at com.HomLuvAutomation.WebDriverThread.instantiateWebDriver(WebDriverThread.java:89)
at com.HomLuvAutomation.WebDriverThread.getDriver(WebDriverThread.java:40)
at com.HomLuvAutomation.DriverFactory.getDriver(DriverFactory.java:46)
at com.HomLuvAutomation.BasicSearchWD.exampleOfTestNgMaven(BasicSearchWD.java:22)
at com.HomLuvAutomation.BasicSearchWD.austinSearch(BasicSearchWD.java:56)