Getting error as "karate.org.apache.http.conn.HttpHostConnectException" while running test cases on Karate - karate

First Case: On Local Eclipse
Issue: While running test cases on Karate, I am getting below error where
Feature file as below:
Background:
* configure driver = { type: 'chrome', start: false, showDriverLog: true }
Scenario: Verify
Given driver 'https://www.google.com/'
And input('input[name=q]', 'karate-dsl')
Console error as below:
15:14:30.630 [main] ERROR com.intuit.karate - karate.org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused), http call failed after 4 milliseconds for url: http://localhost:9222/json
15:14:32.636 [main] DEBUG com.intuit.karate - request:
1 > GET http://localhost:9222/json
1 > Host: localhost:9222
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.13 (Java/1.8.0_321)
1 > Accept-Encoding: gzip,deflate
15:14:32.638 [main] ERROR com.intuit.karate - karate.org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused), http call failed after 3 milliseconds for url: http://localhost:9222/json
15:14:32.640 [main] ERROR com.intuit.karate - driver config / start failed: http call failed after 3 milliseconds for url: http://localhost:9222/json, options: {type=chrome, start=false, showDriverLog=true, target=null}
com.intuit.karate.KarateException: http call failed after 3 milliseconds for url: http://localhost:9222/json
If we make a change in driver config as below as it is hitting the native chrome. It starts to work fine,
configure driver = { type: 'chrome', start: true, showDriverLog: true }
Second Case: On Docker Image, "https://hub.docker.com/r/ptrthomas/karate-chrome", if driver config change as below:
configure driver = { type: 'chrome', start: true, showDriverLog: true }
Getting the same above error on docker image.
Is it supposed to config differently for local and docker image or I am missing something. Can some one please help ?

Related

How to launch protractor tests from remote jenkins?

I am unable to launch my protractor test from remote jenkins.
I am able to launch the test if the jenkins is installed in my local.
I am not sure if it is because of the direct connect. i also tried to launch the protractor test through selenium webdriver but couldnt make it. please help on this.
The error i am getting is
*[16:06:14] I/launcher - Running 1 instances of WebDriver
[16:06:14] I/direct - Using ChromeDriver directly...
[16:16:15] E/launcher - session not created
from timeout: Timed out receiving message from renderer: 600.000
(Session info: chrome=88.0.4324.104)
(Driver info: chromedriver=88.0.4324.96 (68dba2d8a0b149a1d3afac56fa74648032bcf46b-refs/branch-heads/4324#{#1784}),platform=Windows NT 10.0.17763 x86_64)
[16:16:15] E/launcher - SessionNotCreatedError: session not created
from timeout: Timed out receiving message from renderer: 600.000
(Session info: chrome=88.0.4324.104)
(Driver info: chromedriver=88.0.4324.96 (68dba2d8a0b149a1d3afac56fa74648032bcf46b-refs/branch-heads/4324#{#1784}),platform=Windows NT 10.0.17763 x86_64)
at Object.checkLegacyResponse (C:\home\Administrator\workspace\BlueNet_Automation\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (C:\home\Administrator\workspace\BlueNet_Automation\node_modules\selenium-webdriver\lib\http.js:509:13)
at C:\home\Administrator\workspace\BlueNet_Automation\node_modules\selenium-webdriver\lib\http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:93:5)
From: Task: WebDriver.createSession()
at Function.createSession (C:\home\Administrator\workspace\BlueNet_Automation\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
at Function.createSession (C:\home\Administrator\workspace\BlueNet_Automation\node_modules\selenium-webdriver\chrome.js:761:15)
at Direct.getNewDriver (C:\home\Administrator\workspace\BlueNet_Automation\node_modules\protractor\built\driverProviders\direct.js:77:33)
at Runner.createBrowser (C:\home\Administrator\workspace\BlueNet_Automation\node_modules\protractor\built\runner.js:195:43)
at C:\home\Administrator\workspace\BlueNet_Automation\node_modules\protractor\built\runner.js:339:29
at _fulfilled (C:\home\Administrator\workspace\BlueNet_Automation\node_modules\q\q.js:834:54)
at C:\home\Administrator\workspace\BlueNet_Automation\node_modules\q\q.js:863:30
at Promise.promise.promiseDispatch (C:\home\Administrator\workspace\BlueNet_Automation\node_modules\q\q.js:796:13)
at C:\home\Administrator\workspace\BlueNet_Automation\node_modules\q\q.js:556:49
at runSingle (C:\home\Administrator\workspace\BlueNet_Automation\node_modules\q\q.js:137:13)
[16:16:15] E/launcher - Process exited with error code 199
npm ERR! Test failed. See above for more details.
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE*
my config.ts file is
*export let config: Config = {
// The address of a running selenium server.
//seleniumAddress: 'http://localhost:4444/wd/hub',
directConnect:true,
framework:'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
//allScriptsTimeout: 30000,
// Capabilities to be passed to the webdriver instance.
capabilities: {
browserName: 'chrome'
},
// Spec patterns are relative to the configuration file location passed
// to protractor (in this example conf.js).
// They may include glob patterns.
specs: ['../features/MasterEdit.feature'],
cucumberOpts: {
// require step definitions
//tags:"#SmokeTesting",
format:'json:./cucumberreport.json',
require: [
'./stepDefinitions/*.js', // accepts a glob,
]
},
onComplete: () =>{
var options = {
theme: 'bootstrap',
jsonFile: './cucumberreport.json',
output: './cucumber_report.html',
reportSuiteAsScenarios: true,
launchReport: true,
metadata: {
"App Version":"0.3.2",
"Test Environment": "STAGING",
"Browser": "Chrome 54.0.2840.98",
"Platform": "Windows 10",
"Parallel": "Scenarios",
"Executed": "Remote"
}
};
reporter.generate(options);
}*

While executing script it will launch URL in emulator and rest of line are not executing in karate framework

When i executing script it will launch URL"www.google.com" in emulator and rest of line are not executing.
"Please suggest me the solution" Is this way to write elements?
Environment details:
JDK 1.8
Appium v1.17
Node js v12.18
Andriod stuido v4
Feature file:
Feature: Testing Mobile
Scenario: launch chrome in appium
* configure driver =
"""
{
type: 'android',
webDriverPath : "/wd/hub",
start: true,
httpConfig : { readTimeout: 120000 }
}
"""
* def desiredConfig =
"""
{
"newCommandTimeout" : 300,
"platformVersion" : "10.0",
"platformName" : "Android",
"connectHardwareKeyboard" : true,
"deviceName" : "emulator-5554",
"avd" : "Pixel_2_API_29",
"automationName" : "UiAutomator2",
"browserName" : "Chrome" ,
"chromedriverExecutable" : "C:/Users/abc/Downloads/chromedriver_win32_2/chromedriver.exe"
}
"""
* driver { webDriverSession: { desiredCapabilities : "#(desiredConfig)"} }
* driver 'http://google.com'
And delay(4000)
* driver click("//a[text()='Images']")
# driver.input("//input[#name='q']", 'karate dsl')
Logs in console:
10:31:16.654 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [HTTP] --> POST /wd/hub
/session/3b12fd81-db3b-421e-8218-b94c1ed331b5/element
10:31:16.695 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [HTTP] {"using":"xpath","value":"//a[text()
='Images']"}
10:31:16.698 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [debug] [MJSONWP (3b12fd81)] Calling AppiumDrive
r.findElement() with args: ["xpath","//a[text()='Images']","3b12fd81-db3b-421e-8218-b94c1ed331b5"]
10:31:16.699 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [debug] [BaseDriver] Valid locator strategies fo
r this request: xpath, id, class name, accessibility id, -android uiautomator
10:31:16.702 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [debug] [BaseDriver] Waiting up to 0 ms for cond
ition
10:31:16.703 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [debug] [WD Proxy] Matched '/element' to command
name 'findElement'
10:31:16.706 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [debug] [WD Proxy] Proxying [POST /element] to [
POST http://127.0.0.1:8203/wd/hub/session/600582cc-a05b-422e-b886-7daeff02de45/element] with body: {"strategy":"xpath","selector":"//a[text()='Images']","context":"","multiple":false}
10:31:17.466 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [WD Proxy] Got response with status 404: {"sessi
onId":"600582cc-a05b-422e-b886-7daeff02de45","value":{"error":"no such element","message":"An element could not be located on the page using the given search parameters","stacktrace":"io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:51)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon...
10:31:17.467 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [debug] [W3C] Matched W3C error code 'no such el
ement' to NoSuchElementError
10:31:17.474 [ForkJoinPool-1-worker-1] DEBUG com.intuit.karate - response time in milliseconds: 823.75
5 < 500
5 < Connection: keep-alive
5 < Content-Length: 164
5 < Content-Type: application/json; charset=utf-8
5 < Date: Wed, 01 Jul 2020 05:01:17 GMT
5 < ETag: W/"a4-/qNMwkKiq6QWZf9aZdImFcg10wM"
5 < Vary: X-HTTP-Method-Override
5 < X-Powered-By: Express
{"status":7,"value":{"message":"An element could not be located on the page using the given search parameters."},"sessionId":"3b12fd81-db3b-421e-8218-b94c1ed331b5"}
10:31:17.478 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [debug] [MJSONWP (3b12fd81)] Encountered interna
l error running command: NoSuchElementError: An element could not be located on the page using the given search parameters.
10:31:17.484 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [debug] [MJSONWP (3b12fd81)] at AndroidUiaut
omator2Driver.findElOrEls (C:\Users\M1058955\AppData\Roaming\npm\node_modules\appium\node_modules\appium-android-driver\lib\commands\find.js:75:11)
10:31:17.484 [ForkJoinPool-1-worker-1] WARN com.intuit.karate - http response code: 500, response: {"sessionId":"3b12fd81-db3b-421e-8218-b94c1ed331b5","value":{"message":"An element could not be located on the page using the given search parameters."},"status":7}, request: [method: POST, responseTime: 823.7536, body: {"using":"xpath","value":"//a[text()='Images']"}]
10:31:17.484 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [HTTP] <-- POST /wd/hub/session/3b12fd81-db
3b-421e-8218-b94c1ed331b5/element 500 819 ms - 164
10:31:17.484 [ForkJoinPool-1-worker-1] WARN c.i.k.driver.android_1593579654225 - locator failed, will retry once: {"sessionId":"3b12fd81-db3b-421e-8218-b94c1ed331b5","value":{"message":"An element could not be located on the page using the given search parameters."},"status":7}
10:31:17.485 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [HTTP]
10:31:20.490 [ForkJoinPool-1-worker-1] DEBUG com.intuit.karate - request:
6 > POST http://localhost:50636/wd/hub/session/3b12fd81-db3b-421e-8218-b94c1ed331b5/element
6 > Accept-Encoding: gzip,deflate
6 > Connection: Keep-Alive
6 > Content-Length: 48
6 > Content-Type: application/json; charset=UTF-8
6 > Host: localhost:50636
6 > User-Agent: Apache-HttpClient/4.5.12 (Java/1.8.0_181)
{"using":"xpath","value":"//a[text()='Images']"}
10:31:20.531 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [HTTP] --> POST /wd/hub
/session/3b12fd81-db3b-421e-8218-b94c1ed331b5/element
10:31:20.532 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [HTTP] {"using":"xpath","value":"//a[text()
='Images']"}
10:31:20.533 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [debug] [MJSONWP (3b12fd81)] Calling AppiumDrive
r.findElement() with args: ["xpath","//a[text()='Images']","3b12fd81-db3b-421e-8218-b94c1ed331b5"]
10:31:20.534 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [debug] [BaseDriver] Valid locator strategies fo
r this request: xpath, id, class name, accessibility id, -android uiautomator
10:31:20.535 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [debug] [BaseDriver] Waiting up to 0 ms for cond
ition
10:31:20.536 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [debug] [WD Proxy] Matched '/element' to command
name 'findElement'
10:31:20.536 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [debug] [WD Proxy] Proxying [POST /element] to [
POST http://127.0.0.1:8203/wd/hub/session/600582cc-a05b-422e-b886-7daeff02de45/element] with body: {"strategy":"xpath","selector":"//a[text()='Images']","context":"","multiple":false}
10:31:21.026 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [WD Proxy] Got response with status 404: {"sessi
onId":"600582cc-a05b-422e-b886-7daeff02de45","value":{"error":"no such element","message":"An element could not be located on the page using the given search parameters","stacktrace":"io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given search parameters\n\tat io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:102)\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:72)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:38)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:252)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:242)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:51)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerCon...
10:31:21.027 [android_1593579654225] DEBUG c.i.k.driver.android_1593579654225 - [debug] [W3C] Matched W3C error code 'no such el
ement' to NoSuchElementError
10:31:21.028 [ForkJoinPool-1-worker-1] DEBUG com.intuit.karate - response time in milliseconds: 498.60
6 < 500
can you please try karate version 0.9.6.RC3 ?, maybe based on you location Images locator might be changing?
xpath
Given driver 'https://www.google.com'
Then waitForUrl('https://www.google.com')
And click("//a[text()='Images']")
And input("//input[#name='q']", 'karate dsl')
should work with this version of karate and appium 1.17.1.

How to invoke Android emulator by using feature file in Karate Framework

Am going to open Google URL in emulator when execute feature file in karate framework.
But i getting test case is failed due to following reason:
17:49:10.459 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.android_1593087505311 - poll attempt #20
for port to be ready - localhost:58674
17:49:13.452 [ForkJoinPool-1-worker-1] DEBUG com.intuit.karate - request:
1 > POST http://localhost:58674/session
1 > Accept-Encoding: gzip,deflate
1 > Connection: Keep-Alive
1 > Content-Length: 58
1 > Content-Type: application/json; charset=UTF-8
1 > Host: localhost:58674
1 > User-Agent: Apache-HttpClient/4.5.12 (Java/1.8.0_181)
{"capabilities":{"alwaysMatch":{"browserName":"android"}}}
"Please provide me solution"
Pre-condition: Appium Server and emulator is running. and below is feature file.
Feature: Mobile automation
Background:
* url 'http://localhost:4723/wd/hub'
* configure driver = { type: 'android' }
* def driverCaps = {"browserName": "chrome","newCommandTimeout":180, "platformVersion": "8.0",
"platformName": "Android","deviceName":"emulator-5554", "avd":"Nexus 6P API 26"}
Scenario: Perform additional operation
Given driver 'https://google.com'
And input("input[name=q]", 'karate dsl')
When submit().click("input[name=btnI]")
# this may fail depending on which part of the world you are in !
Then waitForUrl('https://github.com/intuit/karate')
your driverCaps is unused as you have defined it after configure,
using the below snippet I was able to launch a chrome browser in Android Emulator.
Scenario: launch chrome in appium
* configure driver =
"""
{
type: 'android',
webDriverPath : "/wd/hub",
start: true,
httpConfig : { readTimeout: 120000 }
}
"""
* def desiredConfig =
"""
{
"newCommandTimeout" : 300,
"platformVersion" : "9.0",
"platformName" : "Android",
"connectHardwareKeyboard" : true,
"deviceName" : "emulator-5554",
"avd" : "Pixel2",
"automationName" : "UiAutomator2",
"browserName" : "Chrome"
}
"""
* driver { webDriverSession: { desiredCapabilities : "#(desiredConfig)"} }
* driver 'http://google.com'
* driver.input("//input[#name='q']", 'karate dsl')
Note:
if you are facing any chrome driver issue please refer : chromedriver with Appium
currently only xpath locator are working so try with xpath locators

NightwatchJS /geckodriver/ selenoid: Error retrieving a new session from the selenium server, while executing test on Firefox,

Setup Information:
OS - MacOS HighSierra - 10.13.3
DockerCE for Mac - 17.12.0-ce-mac49
Selenoid, Selenoid-ui - Latest
Firefox - 58, geckodriver - 0.191 (0.190,0.170)
Chrome - 63, ChromeDriver 2.34.522932
Selenium standalone server - 3.9.1
On Local setup the test runs successsfully with Firefox and Chrome
using the same geckodriver.
On Remote setup the test fails while I use Firefox and succeeds using Chrome.
Verbose log from NightwatchJS
Prasannas-MacBook-Air:sim1 prvenkat$ ./node_modules/nightwatch/bin/nightwatch ./src/test/login.js --verbose
[Test / Login] Test Suite
=============================
Running: Validate Login page
INFO Request: POST /wd/hub/session
- data: {"desiredCapabilities":{"browserName":"firefox","javascriptEnabled":true,"acceptSslCerts":true,"platform":"ANY","moz:firefoxOptions":{"log":{"level":"trace"}},"version":"57.0","name":"Test / Login"}}
- headers: {"Content-Type":"application/json; charset=utf-8","Content-Length":199}
INFO Response 200 POST /wd/hub/session (3439ms) { value:
{ sessionId: '43ba7a2a-8fac-4ebb-8a8f-e046e5534944',
capabilities:
{ acceptInsecureCerts: false,
browserName: 'firefox',
browserVersion: '57.0',
'moz:accessibilityChecks': false,
'moz:headless': false,
'moz:processID': 37,
'moz:profile': '/tmp/rust_mozprofile.i3MIoxBzkGAM',
'moz:webdriverClick': false,
pageLoadStrategy: 'normal',
platformName: 'linux',
platformVersion: '4.9.60-linuxkit-aufs',
rotatable: false,
timeouts: { implicit: 0, pageLoad: 300000, script: 30000 } } } }
Error retrieving a new session from the selenium server
Connection refused! Is selenium server started?
{ value:
{ sessionId: '43ba7a2a-8fac-4ebb-8a8f-e046e5534944',
capabilities:
{ acceptInsecureCerts: false,
browserName: 'firefox',
browserVersion: '57.0',
'moz:accessibilityChecks': false,
'moz:headless': false,
'moz:processID': 37,
'moz:profile': '/tmp/rust_mozprofile.i3MIoxBzkGAM',
'moz:webdriverClick': false,
pageLoadStrategy: 'normal',
platformName: 'linux',
platformVersion: '4.9.60-linuxkit-aufs',
rotatable: false,
timeouts: [Object] } } }
Trace log from the Docker container
Initialize...
Connecting to ws://localhost:8080/ws/logs/43ba7a2a-8fac-4ebb-8a8f-e046e5534944...
Connected!
--- x11vnc loop: 1 ---
2018/02/22 05:20:47 Loading configuration files...
2018/02/22 05:20:47 Loaded configuration from [/etc/selenoid/browsers.json]
2018/02/22 05:20:47 Using default containers log configuration because of:read error: open config/container-logs.json: no such file or directory
2018/02/22 05:20:47 Timezone: UTC
2018/02/22 05:20:47 Listening on :4444
2018/02/22 05:20:47 [NEW_REQUEST]
2018/02/22 05:20:47 [NEW_REQUEST_ACCEPTED]
2018/02/22 05:20:47 [0] [LOCATING_SERVICE] [firefox-57.0]
2018/02/22 05:20:47 [0] [USING_DRIVER] [firefox-57.0]
2018/02/22 05:20:47 [0] [ALLOCATING_PORT]
2018/02/22 05:20:47 [0] [ALLOCATED_PORT] [41809]
2018/02/22 05:20:47 [0] [STARTING_PROCESS] [[/usr/bin/geckodriver --host :: --log debug --port=41809]]
1519276847981 geckodriver INFO geckodriver 0.19.1
1519276847981 webdriver::httpapi DEBUG Creating routes
1519276847986 geckodriver INFO Listening on [::]:41809
1519276848032 webdriver::server DEBUG -> HEAD /
1519276848160 webdriver::server DEBUG <- 404 Not Found {"value":{"error":"unknown command","message":"HEAD / did not match a known command","stacktrace":"stack backtrace:\n 0: 0x4edb3c - backtrace::backtrace::trace::hc4bd56a2f176de7e\n 1: 0x4edb72 - backtrace::capture::Backtrace::new::he3b2a15d39027c46\n 2: 0x440ac8 - webdriver::error::WebDriverError::new::ha0fbd6d1a1131b43\n 3: 0x43a665 - <webdriver::server::HttpHandler<U> as hyper::server::Handler>::handle::h343049f2e1aa3f13\n 4: 0x404b4d - std::sys_common::backtrace::__rust_begin_short_backtrace::he840f14c79c8e321\n 5: 0x40bee6 - std::panicking::try::do_call::hdd1d6b985699ef9d\n 6: 0x5e6a6c - panic_unwind::__rust_maybe_catch_panic\n at /checkout/src/libpanic_unwind/lib.rs:99\n 7: 0x41ef02 - <F as alloc::boxed::FnBox<A>>::call_box::hae8ac6ade91dedb6\n 8: 0x5df13b - alloc::boxed::{{impl}}::call_once<(),()>\n at /checkout/src/liballoc/boxed.rs:692\n - std::sys_common::thread::start_thread\n at /checkout/src/libstd/sys_common/thread.rs:21\n - std::sys::imp::thread::{{impl}}::new::thread_start\n at /checkout/src/libstd/sys/unix/thread.rs:84"}}
2018/02/22 05:20:48 [0] [PROCESS_STARTED] [32] [181.491408ms]
2018/02/22 05:20:48 [0] [PROXYING_REQUESTS] [http://127.0.0.1:41809]
2018/02/22 05:20:48 [0] [SESSION_ATTEMPTED] [unknown] [http://127.0.0.1:41809] [1]
1519276848161 webdriver::server DEBUG -> POST /session {"desiredCapabilities":{"browserName":"firefox","javascriptEnabled":true,"acceptSslCerts":true,"platform":"ANY","moz:firefoxOptions":{"log":{"level":"trace"}},"version":"57.0","name":"Test / Login"}}
1519276848167 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-profile" "/tmp/rust_mozprofile.i3MIoxBzkGAM"
1519276848171 geckodriver::marionette TRACE connection attempt 0/600
1519276848271 geckodriver::marionette TRACE connection attempt 1/600
--- x11vnc loop: waiting for: 61
1519276848372 geckodriver::marionette TRACE connection attempt 2/600
PORT=5900
1519276848474 geckodriver::marionette TRACE connection attempt 3/600
1519276848575 geckodriver::marionette TRACE connection attempt 4/600
1519276848677 geckodriver::marionette TRACE connection attempt 5/600
1519276848694 Marionette DEBUG Received observer notification "profile-after-change"
1519276848755 Marionette DEBUG Received observer notification "command-line-startup"
1519276848756 Marionette INFO Enabled via --marionette
1519276848778 geckodriver::marionette TRACE connection attempt 6/600
1519276848880 geckodriver::marionette TRACE connection attempt 7/600
1519276848980 geckodriver::marionette TRACE connection attempt 8/600
1519276849081 geckodriver::marionette TRACE connection attempt 9/600
1519276849183 geckodriver::marionette TRACE connection attempt 10/600
1519276849285 geckodriver::marionette TRACE connection attempt 11/600
1519276849386 geckodriver::marionette TRACE connection attempt 12/600
1519276849487 geckodriver::marionette TRACE connection attempt 13/600
1519276849589 geckodriver::marionette TRACE connection attempt 14/600
1519276849690 geckodriver::marionette TRACE connection attempt 15/600
1519276849792 geckodriver::marionette TRACE connection attempt 16/600
1519276849894 geckodriver::marionette TRACE connection attempt 17/600
1519276849930 Marionette DEBUG Received observer notification "sessionstore-windows-restored"
1519276849996 geckodriver::marionette TRACE connection attempt 18/600
1519276850097 geckodriver::marionette TRACE connection attempt 19/600
1519276850197 geckodriver::marionette TRACE connection attempt 20/600
1519276850298 geckodriver::marionette TRACE connection attempt 21/600
1519276850399 geckodriver::marionette TRACE connection attempt 22/600
1519276850499 geckodriver::marionette TRACE connection attempt 23/600
1519276850600 geckodriver::marionette TRACE connection attempt 24/600
1519276850679 Marionette DEBUG Setting recommended pref toolkit.cosmeticAnimations.enabled to false
1519276850681 Marionette DEBUG Setting recommended pref datareporting.policy.dataSubmissionPolicyAccepted to false
1519276850681 Marionette DEBUG Setting recommended pref extensions.e10sBlocksEnabling to false
1519276850682 Marionette DEBUG New connections are accepted
1519276850683 Marionette INFO Listening on port 37569
1519276850702 geckodriver::marionette DEBUG Connected to Marionette onlocalhost:37569
1519276850712 Marionette DEBUG Accepted connection 0 from 127.0.0.1:42836
1519276850714 geckodriver::marionette TRACE <- {"applicationType":"gecko","marionetteProtocol":3}
1519276850714 geckodriver::marionette TRACE -> 315:[0,1,"newSession",{"acceptSslCerts":true,"browserName":"firefox","capabilities":{"desiredCapabilities":{"acceptSslCerts":true,"browserName":"firefox","javascriptEnabled":true,"name":"Test / Login","platform":"ANY","version":"57.0"}},"javascriptEnabled":true,"name":"Test / Login","platform":"ANY","version":"57.0"}]
1519276850717 Marionette TRACE 0 -> [0,1,"newSession",{"acceptSslCerts":true,"browserName":"firefox","capabilities":{"desiredCapabilities":{"acceptSslCerts":true,"browserName":"firefox","javascriptEnabled":true,"name":"Test / Login","platform":"ANY","version":"57.0"}},"javascriptEnabled":true,"name":"Test / Login","platform":"ANY","version":"57.0"}]
1519276850783 Marionette DEBUG Register listener.js for window 2147483649
1519276850806 Marionette TRACE 0 <- [1,1,null,{"sessionId":"43ba7a2a-8fac-4ebb-8a8f-e046e5534944","capabilities":{"browserName":"firefox","browserVersion":"57.0","platformName":"linux","platformVersion":"4.9.60-linuxkit-aufs","pageLoadStrategy":"normal","acceptInsecureCerts":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"rotatable":false,"moz:accessibilityChecks":false,"moz:headless":false,"moz:processID":37,"moz:profile":"/tmp/rust_mozprofile.i3MIoxBzkGAM","moz:webdriverClick":false}}]
1519276850809 geckodriver::marionette TRACE <- [1,1,null,{"sessionId":"43ba7a2a-8fac-4ebb-8a8f-e046e5534944","capabilities":{"browserName":"firefox","browserVersion":"57.0","platformName":"linux","platformVersion":"4.9.60-linuxkit-aufs","pageLoadStrategy":"normal","acceptInsecureCerts":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"rotatable":false,"moz:accessibilityChecks":false,"moz:headless":false,"moz:processID":37,"moz:profile":"/tmp/rust_mozprofile.i3MIoxBzkGAM","moz:webdriverClick":false}}]
1519276850809 webdriver::server DEBUG <- 200 OK {"value": {"sessionId":"43ba7a2a-8fac-4ebb-8a8f-e046e5534944","capabilities":{"acceptInsecureCerts":false,"browserName":"firefox","browserVersion":"57.0","moz:accessibilityChecks":false,"moz:headless":false,"moz:processID":37,"moz:profile":"/tmp/rust_mozprofile.i3MIoxBzkGAM","moz:webdriverClick":false,"pageLoadStrategy":"normal","platformName":"linux","platformVersion":"4.9.60-linuxkit-aufs","rotatable":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000}}}}
2018/02/22 05:20:50 [0] [SESSION_CREATED] [unknown] [43ba7a2a-8fac-4ebb-8a8f-e046e5534944] [http://127.0.0.1:41809] [1] [2.832759113s]
2018/02/22 05:21:50 [SESSION_DELETED] [43ba7a2a-8fac-4ebb-8a8f-e046e5534944]
1519276910817 webdriver::server DEBUG -> DELETE /session/43ba7a2a-8fac-4ebb-8a8f-e046e5534944
1519276910819 geckodriver::marionette TRACE -> 37:[0,2,"quit",{"flags":["eForceQuit"]}]
1519276910827 Marionette TRACE 0 -> [0,2,"quit",{"flags":["eForceQuit"]}]
1519276910830 Marionette DEBUG New connections will no longer be accepted
1519276910973 Marionette TRACE 0 <- [1,2,null,{"cause":"shutdown"}]
1519276911015 geckodriver::marionette TRACE <- [1,2,null,{"cause":"shutdown"}]
1519276911015 webdriver::server DEBUG Deleting session
1519276911015 geckodriver::marionette DEBUG Stopping browser process
1519276911077 webdriver::server DEBUG <- 200 OK {"value": {}}
2018/02/22 05:21:51 [0] [TERMINATING_PROCESS] [32]
2018/02/22 05:21:51 [0] [TERMINATED_PROCESS] [32]
Disconnected
I had tested the scenario with three different geckodriver but the result was same.
Please help.
The error says it all :
1519276847986 geckodriver INFO Listening on [::]:41809
1519276848032 webdriver::server DEBUG -> HEAD /
1519276848160 webdriver::server DEBUG <- 404 Not Found {"value":{"error":"unknown command","message":"HEAD / did not match a known command","stacktrace":"stack backtrace:\n 0: 0x4edb3c - backtrace::backtrace::trace::hc4bd56a2f176de7e\n 1: 0x4edb72 - backtrace::capture::Backtrace::new::he3b2a15d39027c46\n 2: 0x440ac8 - webdriver::error::WebDriverError::new::ha0fbd6d1a1131b43\n 3: 0x43a665 - <webdriver::server::HttpHandler<U> as hyper::server::Handler>::handle::h343049f2e1aa3f13\n 4: 0x404b4d - std::sys_common::backtrace::__rust_begin_short_backtrace::he840f14c79c8e321\n 5: 0x40bee6 - std::panicking::try::do_call::hdd1d6b985699ef9d\n 6: 0x5e6a6c - panic_unwind::__rust_maybe_catch_panic\n at /checkout/src/libpanic_unwind/lib.rs:99\n 7: 0x41ef02 - <F as alloc::boxed::FnBox<A>>::call_box::hae8ac6ade91dedb6\n 8: 0x5df13b - alloc::boxed::{{impl}}::call_once<(),()>\n at /checkout/src/liballoc/boxed.rs:692\n - std::sys_common::thread::start_thread\n at /checkout/src/libstd/sys_common/thread.rs:21\n - std::sys::imp::thread::{{impl}}::new::thread_start\n at /checkout/src/libstd/sys/unix/thread.rs:84"}}
Due to this issue the SESSION gets DELETED as follows :
2018/02/22 05:20:50 [0] [SESSION_CREATED] [unknown] [43ba7a2a-8fac-4ebb-8a8f-e046e5534944] [http://127.0.0.1:41809] [1] [2.832759113s]
2018/02/22 05:21:50 [SESSION_DELETED] [43ba7a2a-8fac-4ebb-8a8f-e046e5534944]
The error stack trace clearly mentions that Selenium Language Binding Art is attempting to connect on the IPv6 loopback address ([::]:41809), which won't work at all with 3.9.x as per #JimEvans comment in the discussion thread Can't launch Selenium IE Driver after upgrading to version 3.9
Solution
A possible solution would be to disable IPv6 loopback address and enable IPv4 on the Remote setup and execute your Test.
Have a look here:
https://github.com/nightwatchjs/nightwatch/issues/1628#issuecomment-357746215
That means you will have to fallback to 3.8 and a selenium Grid setup.

WebDriverError - missing 'type' parameter

I am getting the following error:
[23:31:47] I/launcher - Running 1 instances of WebDriver
[23:31:47] I/hosted - Using the selenium server at http://seleniumbox.cisco.com:80/wd/hub
[23:31:51] E/runner - Unable to start a WebDriver session.
[23:31:51] E/launcher - Error: WebDriverError: Missing 'type' parameter
I have the following Protractor config:
multiCapabilities: [
{
browserName: 'firefox',
auth: 'qn4gn6i63h3bo25i',
firefoxOptions: {
auth: 'qn4gn6i63h3bo25i',
args: ['--headless']
},
'moz:firefoxOptions': {
auth: 'qn4gn6i63h3bo25i',
args: ['--headless']
}
}
]
I think the "type parameter" might relate the auth method, because before I add the auth information (I had to auth in multiple places because I don't know the right place...), I was getting this error:
[23:35:38] I/launcher - Running 1 instances of WebDriver
[23:35:38] I/hosted - Using the selenium server at http://seleniumbox.cisco.com:80/wd/hub
[23:35:38] E/launcher - Mandatory capability missing[auth]
[23:35:38] E/launcher - SessionNotCreatedError: Mandatory capability missing[auth]
Does anyone know if this type parameter relates to auth? How do I fix this error?