I am currently having an issue trying to run Protractor tests on my Angular2 site when using GeckoDriver.
I am using Selenium Standalone Server to run my tests and they work in Chrome and IE11 but when I try to run with Firefox I get the following error:
Failed: Error while running testForAngular: Error: Permission denied to access property "invoke"
Build info: version: '3.3.1', revision: '5234b32', time: '2017-03-10 09:04:52 -0800'
System info: host: 'MyPC', ip: '128.87.191.161', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=C:\Users\Me\AppData\Local\Temp\rust_mozprofile.UbDrIDtk4eEX, rotatable=false, timeouts={implicit=0, page load=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=52.0, platformVersion=6.1, moz:processID=12820, browserName=firefox, platformName=windows_nt}]
Session ID: 6ddf7356-5306-4db6-b6c2-2898406c3193
Build info: version: '3.3.1', revision: '5234b32', time: '2017-03-10 09:04:52 -0800'
System info: host: 'MyPC', ip: '128.87.191.161', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=C:\Users\Me\AppData\Local\Temp\rust_mozprofile.UbDrIDtk4eEX, rotatable=false, timeouts={implicit=0, page load=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=52.0, platformVersion=6.1, moz:processID=12820, browserName=firefox, platformName=windows_nt}]
Session ID: 6ddf7356-5306-4db6-b6c2-2898406c3193
at AbstractExtendedWebDriver.get.timeout.driver.controlFlow.execute.then.then.then.then.then.then.executeAsyncScript_.then (c:\Projects\Project\ProtractorTests\node_modules\protractor\lib\browser.ts:944:27)
at ManagedPromise.invokeCallback_ (c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\lib\promise.js:1366:14)
at TaskQueue.execute_ (c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\lib\promise.js:2970:14)
at TaskQueue.executeNext_ (c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\lib\promise.js:2953:27)
at events.EventEmitter.events.EventEmitter.events.EventEmitter.scheduleCallbacks.asyncRun (c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\lib\promise.js:2813:27)
at c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\lib\promise.js:676:7
at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: Run beforeEach in control flow
From asynchronous test:
Error
at Suite.<anonymous> (C:\Projects\Project\ProtractorTests\specs\login-spec.ts:10:5)
at Object.<anonymous> (C:\Projects\Project\ProtractorTests\specs\login-spec.ts:8:1)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Array.forEach (native)
If I try to run the Firefox tests using directConnet I get another error:
[09:37:35] E/launcher - Unable to parse new session response: {"value": {"sessionId":"b00ee8b7-434e-48e6-83a6-3bca08caba31","value":{"acceptInsecureCerts":false,"browserName":"firefox","browserVersion":"52.0","moz:accessibilityChecks":false,"moz:processID":15632,"moz:profile":"C:\\Users\\Me\\AppData\\Local\\Temp\\rust_mozprofile.XS9ezQUYQ7um","pageLoadStrategy":"normal","platformName":"windows_nt","platformVersion":"6.1","rotatable":false,"specificationLevel":0,"timeouts":{"implicit":0,"page load":300000,"script":30000}}}}
[09:37:35] E/launcher - WebDriverError: Unable to parse new session response: {"value": {"sessionId":"b00ee8b7-434e-48e6-83a6-3bca08caba31","value":{"acceptInsecureCerts":false,"browserName":"firefox","browserVersion":"52.0","moz:accessibilityChecks":false,"moz:processID":15632,"moz:profile":"C:\\Users\\Me\\AppData\\Local\\Temp\\rust_mozprofile.XS9ezQUYQ7um","pageLoadStrategy":"normal","platformName":"windows_nt","platformVersion":"6.1","rotatable":false,"specificationLevel":0,"timeouts":{"implicit":0,"page load":300000,"script":30000}}}}
at __dirname.execute.request.then.doSend.then.response (c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\lib\http.js:445:19)
at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.createSession()
at Function.createSession (c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\lib\webdriver.js:777:24)
at Function.createSession (c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\firefox\index.js:640:55)
at Direct.getNewDriver (c:\Projects\Project\ProtractorTests\node_modules\protractor\built\driverProviders\direct.js:95:33)
at Runner.createBrowser (c:\Projects\Project\ProtractorTests\node_modules\protractor\built\runner.js:194:43)
at events_1.EventEmitter.run.q.then.then (c:\Projects\Project\ProtractorTests\node_modules\protractor\built\runner.js:338:29)
at _fulfilled (c:\Projects\Project\ProtractorTests\node_modules\q\q.js:834:54)
at Promise.then.Q.nextTick.self.promiseDispatch.done (c:\Projects\Project\ProtractorTests\node_modules\q\q.js:863:30)
at Promise.__dirname.Promise.promise.promiseDispatch (c:\Projects\Project\ProtractorTests\node_modules\q\q.js:796:13)
at c:\Projects\Project\ProtractorTests\node_modules\q\q.js:556:49
at runSingle (c:\Projects\Project\ProtractorTests\node_modules\q\q.js:137:13)
[09:37:35] E/launcher - Process exited with error code 199
Not sure where to go from here!
Versions
Angular: 2.4.6
Protractor: 5.1.1
Selenium Standalone Server: 3.3.1
GeckoDriver: 0.15.0
Firefox Browser: 52.0
The Permission denied to access property "invoke" is a known issue in Zone.js, specific to Zone.js and Firefox running with WebDriver. It was fixed in the 0.8.7 release. The issue involves how Zone.js patches the browser, and the only fix is to upgrade.
The Unable to parse new session response is also a known issue with Firefox 52 and directConnect: true. Unfortunately, the only solution is to use Selenium Standalone.
Related
I am trying to run my protractor scripts on jenkins pipeline and getting the SessionNotCreatedError when it tries to access the Selenium address. When I run the same on local its working fine. Not sure what's going on.
Conf.js script
let domainName = util.domainName;
exports.config = {
seleniumAddress: 'http://selenium-hub:4444/wd/hub', //for testing in the pipeline
directConnect: false, // Set to true for local testing, or provide a link to a running selenium grid.
// specs: ['e2e/**/mailbox-test.js', 'e2e/**/email-dumps-test.js'],
specs: ['e2e/**/*-test.js'],
capabilities: {
browserName: 'chrome',
acceptInsecureCerts: true,
'goog:chromeOptions': {
w3c: false,
args: [
'--no-sandbox',
'--headless',
'--disable-gpu',
'--window-size=1200,1200',
'--disable-dev-shm-usage',
'--allow-insecure-localhost',
'--allow-running-insecure-content',
'--ignore_ssl',
'--user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36',
],
},
},
allScriptsTimeout: 600000,
baseUrl: eaUrl,
framework: 'jasmine',
jasmineNodeOpts: {
isVerbose: true,
showColors: true,
includeStackTrace: true,
defaultTimeoutInterval: 600000,
stackTrace: false
},
Jenkins output error
[15:32:21] D/launcher - Protractor version: 5.4.2 10:31:59 [15:32:21]
D/launcher - Your base url for tests is
https://ea-webapp-int-raven.ocp-nonprod.ice.dhs.gov/ 10:31:59
[15:32:21] I/launcher - Running 1 instances of WebDriver 10:31:59
[15:32:21] I/hosted - Using the selenium server at
http://selenium-hub:4444/wd/hub 10:37:05 [15:37:21] E/launcher -
Could not start a new session. New session request timed out 10:37:05
Build info: version: '4.1.2', revision: '9a5a329c5a' 10:37:05 System
info: host: 'eb3088c85a9d', ip: '172.17.0.2', os.name: 'Linux',
os.arch: 'amd64', os.version: '3.10.0-1160.53.1.el7.x86_64',
java.version: '11.0.13' 10:37:05 Driver info: driver.version: unknown
10:37:05 [15:37:21] E/launcher - SessionNotCreatedError: Could not
start a new session. New session request timed out 10:37:05 Build
info: version: '4.1.2', revision: '9a5a329c5a' 10:37:05 System info:
host: 'eb3088c85a9d', ip: '172.17.0.2', os.name: 'Linux', os.arch:
'amd64', os.version: '3.10.0-1160.53.1.el7.x86_64', java.version:
'11.0.13' 10:37:05 Driver info: driver.version: unknown 10:37:05
at Object.throwDecodedError
(/app/test/node_modules/selenium-webdriver/lib/error.js:514:15)
10:37:05 at parseHttpResponse
(/app/test/node_modules/selenium-webdriver/lib/http.js:519:13)
10:37:05 at doSend.then.response
(/app/test/node_modules/selenium-webdriver/lib/http.js:441:30)
10:37:05 at process._tickCallback
(internal/process/next_tick.js:68:7) 10:37:05 From: Task:
WebDriver.createSession() 10:37:05 at Function.createSession
(/app/test/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
10:37:05 at Function.createSession
(/app/test/node_modules/selenium-webdriver/chrome.js:761:15) 10:37:05
at createDriver
(/app/test/node_modules/selenium-webdriver/index.js:170:33) 10:37:05
at Builder.build
(/app/test/node_modules/selenium-webdriver/index.js:626:16) 10:37:05
at Hosted.getNewDriver
(/app/test/node_modules/protractor/built/driverProviders/driverProvider.js:53:33)
10:37:05 at Runner.createBrowser
(/app/test/node_modules/protractor/built/runner.js:195:43) 10:37:05
at q.then.then
(/app/test/node_modules/protractor/built/runner.js:339:29) 10:37:05
at _fulfilled (/app/test/node_modules/q/q.js:834:54) 10:37:05 at
/app/test/node_modules/q/q.js:863:30 10:37:05 at
Promise.promise.promiseDispatch (/app/test/node_modules/q/q.js:796:13)
10:37:05 [15:37:21] E/launcher - Process exited with error code 199
10:37:05 10:37:05 exitStatus=$? 10:37:05 10:37:05 # Allow the
Jenkin pipeline to access and archive any test output. 10:37:05 chmod
-R 777 ./test_output/
I am adding my observations as others might need if they get similar issues and this might help them too. After a long long investigation of the console output in Jenkins with my docker installation scripts, I noticed that we are trying to install the latest version of the selenium hub and chrome node but the docker command doesn't include the SE_EVENT_BUS_HOST information. After changing my code from
docker run -d --name selenium-node-chrome -e HUB_HOST=selenium-hub --shm-size="2g" nexus2.xxx.com:18443/selenium/node-chrome
to
docker run -d --name selenium-node-chrome -e SE_EVENT_BUS_HOST=selenium-hub --shm-size="2g" -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 nexus2.xxx.com:18443/selenium/node-chrome
Then it started working for me.
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.
I'm doing a simple form submit using the click method:
$this->url('/');
$move = $this->byName('move');
$move->click();
$content = $this->byTag('body')->text();
But I can't understand the error message I get from Selenium:
PHPUnit_Extensions_Selenium2TestCase_WebDriverException:
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'
System info: host: 'olle-GA-H81M-S2H', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-51-generic', java.version: '1.8.0_141'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=/tmp/rust_mozprofile.EeZF7cCPXFo3, rotatable=false, timeouts={implicit=0, pageLoad=300000, script=30000}, pageLoadStrategy=normal, moz:headless=false, platform=LINUX, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=56.0, platformVersion=4.4.0-51-generic, moz:processID=6598, browserName=firefox, javascriptEnabled=true, platformName=LINUX}]
Session ID: eae99c32-7401-4892-9190-e242b3b81f5a
I can var_dump the $move button and confirm that is no null. Any ideas?
The PHP backtrace:
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase/Driver.php:165
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase/Driver.php:175
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase/CommandsHolder.php:100
tests/questions/DateTimeValidationTest.php:215
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase.php:371
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase.php:337
Edit: Above was the gecko driver. I get a similar error for the Facebook driver:
Facebook\WebDriver\Exception\UnrecognizedExceptionException:
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'
System info: host: 'olle-GA-H81M-S2H', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-51-generic', java.version: '1.8.0_141'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=/tmp/rust_mozprofile.TpTQ5MWyL1hl, rotatable=false, timeouts={implicit=0, pageLoad=300000, script=30000}, pageLoadStrategy=normal, moz:headless=false, platform=LINUX, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=56.0, platformVersion=4.4.0-51-generic, moz:processID=9146, browserName=firefox, javascriptEnabled=true, platformName=LINUX}]
Session ID: 56036593-dc86-4132-9d0f-78beb369b35c
vendor/facebook/webdriver/lib/Exception/WebDriverException.php:158
vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:320
vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:535
vendor/facebook/webdriver/lib/Remote/RemoteExecuteMethod.php:40
vendor/facebook/webdriver/lib/Remote/RemoteWebElement.php:81
tests/questions/FacebookDriverTest.php:42
The HTML for the button is:
<button type="submit" value="movesubmit" name="move" accesskey="l" class="ls-move-btn ls-move-submit-btn btn btn-lg btn-primary">
Submeter
</button>
Edit 2: Exception from selenium:
15:35:15.177 INFO - Executing: [find element: By.name: move])
15:35:15.193 INFO - Done: [find element: By.name: move]
1509374115699 addons.productaddons INFO downloadXHR File download. status=200
1509374115702 addons.productaddons INFO Downloaded file will be saved to /tmp/tmpaddon-e50bf4
1509374116634 DeferredSave.webext.sc.lz4 DEBUG Starting write
1509374116639 DeferredSave.webext.sc.lz4 DEBUG Write succeeded
15:35:17.196 INFO - Executing: [click: 0 [[FirefoxDriver: firefox on LINUX (32c1dfec-9af4-448f-86fa-3a41035bf6b5)] -> name: move]])
15:35:17.501 WARN - Exception thrown
org.openqa.selenium.ElementNotInteractableException:
Edit 3: Mystery solved, I had two buttons with the same name, and the first one was hidden. Hence, the exception. Solved by putting a proper ID on the element I want to interact with.
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.
When running Selenium 2.53.1 on a Win7Pro machine, I get the error below. I found that it is a bug in Firefox. But as I am using version 49.0.2, I did not expect this error because it was resolved.
How can I resolve this?
Option #1:
I remembered I installed an older version (48.0.2). I removed all versions of FF and installed the latest version. Unfortunatly this did not solve my issue.
Option #2:
When I changed the url, for the acceptance env instead of test, I was able to enter values and process testcases. Might be the SSL certificates???
Note:
As my reputation was not enough to ask my question here I had to ask it in a new one.
Also if more info is needed, I will add it.
2016-11-08 11:22:07,316 - INFO nl.spp.BrowserController - Configuring firefox
2016-11-08 11:22:07,434 - INFO nl.spp.BrowserController - Starting firefox
1478600528072 geckodriver INFO Listening on 127.0.0.1:44190
1478600528098 mozprofile::profile INFO Using profile path C:\Users\AD529~1.DIA\AppData\Local\Temp\rust_mozprofile.wOU06Xtrmvik
1478600528101 geckodriver::marionette INFO Starting browser C:\Program Files (x86)\Mozilla Firefox\firefox.exe
1478600528113 geckodriver::marionette INFO Connecting to Marionette on localhost:51363
1478600530286 Marionette INFO Listening on port 51363
1478600532338 Marionette INFO startBrowser 521e1fd8-3c94-4c4e-a244-cfbf62c951d8
2016-11-08 11:22:12,841 - INFO nl.spp.BrowserController - Firefox loaded.
2016-11-08 11:22:12,862 - DEBUG nl.spp.Controller - Loading: https://cimlamp12/login
2016-11-08 11:22:13,287 - DEBUG nl.spp.FrameWork - Error loading page (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 407 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: 'Computer0139', ip: '10.3.0.204', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_102'
Driver info: org.openqa.selenium.firefox.MarionetteDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, marionette=true, appBuildId=20161019084923, version=, platform=XP, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, processId=4600, binary=C:\Program Files (x86)\Mozilla Firefox\firefox.exe, browserVersion=49.0.2, platformVersion=6.1, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=windows_nt, device=desktop, firefox_profile=UEsDBBQACAgIAMNaaEkAAAAAAAAAA...}]
Session ID: 521e1fd8-3c94-4c4e-a244-cfbf62c951d8
2016-11-08 11:22:13,289 - ERROR TestResultsLogger - Error loading page (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 407 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: 'Computer0139', ip: '10.3.0.204', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_102'
Driver info: org.openqa.selenium.firefox.MarionetteDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, marionette=true, appBuildId=20161019084923, version=, platform=XP, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, processId=4600, binary=C:\Program Files (x86)\Mozilla Firefox\firefox.exe, browserVersion=49.0.2, platformVersion=6.1, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=windows_nt, device=desktop, firefox_profile=UEsDBBQACAgIAMNaaEkAAAAAAAAAA...}]
Session ID: 521e1fd8-3c94-4c4e-a244-cfbf62c951d8
2016-11-08 11:22:13,305 - ERROR TestResultsLogger - TestCase: TCDI01 failed! 2016-11-08_11-22-13.305
2016-11-08 11:22:13,327 - INFO nl.spp.Controller - Stopping firefox
Child 3732 ###!!! ABORT: Aborting on channel error.: file c:/builds/moz2_slave/m-rel-w32-00000000000000000000/build/src/ipc/glue/MessageChannel.cpp, line 2052
Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: 'Computer0139', ip: '10.3.0.204', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_102'
Driver info: driver.version: RemoteWebDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, marionette=true, appBuildId=20161019084923, version=, platform=XP, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, processId=4036, binary=C:\Program Files (x86)\Mozilla Firefox\firefox.exe, browserVersion=49.0.2, platformVersion=6.1, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=windows_nt, device=desktop, firefox_profile=UEsDBBQACAgIAC9WaEkAAAAAAAAAA...}]
Session ID: 927daba8-9f7c-4e69-ac4c-a0a1ce1b7b39
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:665)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:701)
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:526)
at nl.spp.Controller.stopBrowser(Controller.java:213)
at nl.spp.FrameWork.running(FrameWork.java:140)
at nl.spp.FrameWork.start(FrameWork.java:80)
at nl.spp.Apl.main(Apl.java:37)
Caused by: java.lang.IllegalStateException: UnixUtils may not be used on Windows
at org.openqa.selenium.os.ProcessUtils.getProcessId(ProcessUtils.java:189)
at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.getPID(UnixProcess.java:222)
at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.access$3(UnixProcess.java:221)
at org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:132)
at org.openqa.selenium.os.CommandLine.destroy(CommandLine.java:155)
at org.openqa.selenium.remote.service.DriverService.stop(DriverService.java:196)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:94)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644)
... 6 more
The code I use to start FF:
public WebDriver loadBrowser(String strBrowser) {
WebDriver driver = null;
//String Xport = System.getProperty("lmportal.xvfb.id", ":1");
//System.setProperty("webdriver.gecko.driver", "C:\\Programs\\GeckoDriver\\geckodriver.exe");
System.setProperty("webdriver.gecko.driver", "F:\\Project\\GeckoDriver\\wires.exe");
//System.setProperty("webdriver.firefox.marionette", "C:\\Programs\\GeckoDriver\\geckodriver.exe");
if(strBrowser.equals("FireFox")) {
// Start FireFox
log.info("Configuring firefox");
//Now you can initialize marionette driver to launch firefox
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
//Windows config
capabilities.setCapability("binary", "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
//Linux config
//capabilities.setCapability("binary", "/usr/bin/firefox");
//setting the profile
FirefoxProfile profile = new FirefoxProfile();
profile.setEnableNativeEvents(true);
profile.setPreference( "intl.accept_languages", "no,en-us,en" );
profile.setPreference( "privacy.clearOnShutdown.cookies", true );
profile.setPreference( "privacy.clearOnShutdown.formdata", true );
profile.setPreference( "privacy.donottrackheader.enabled", true );
profile.setPreference( "browser.tabs.tabMaxWidth", 100 );
profile.setPreference( "browser.cache.disk.capacity", 10240 );
profile.setPreference( "browser.link.open_newwindow.override.external", 2);
capabilities.setCapability(FirefoxDriver.PROFILE, profile);
log.info("Starting firefox");
//setting the environment
driver = new MarionetteDriver(capabilities);
driver.manage().timeouts().implicitlyWait(Long.parseLong(conConfig.getProperty("Implicit wait")), TimeUnit.SECONDS);
log.info("Firefox loaded.");
}
else if(strBrowser.equals("Chrome")) {
log.info("Starting chrome");
System.setProperty("webdriver.chrome.driver", "C:\\Program Files (x86)\\Google\\ChromeDriver2016\\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(Long.parseLong(conConfig.getProperty("Implicit wait")), TimeUnit.SECONDS);
log.info("Chrome loaded.");
}
return driver;
}