0

My test suite works fine locally as well as in gitlab pipeline using Chrome.

However, they fail right on the login page when running them with Chrome (only) on Remote Testing frameworks.
I tested BrowserStack and LamdaTest and they both fail when I attempt to enter text in a form input field.

Error message is:

{"sessionId":"d6c0edadf898c18d38e9dda073a868fa","status":61,"value":{"message":"invalid argument: 'value' must be a list\n (Session info: chrome=80.0.3987.87)\n (Driver info: chromedriver=80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}),platform=Windows NT 10.0.14393 x86_64)"}}

The same tests work on Safari and Firefox, only Chrome fails. I spent some time investigating with the guys at LambdaTest and it seems it all works fine when using "regular" selenium selectors and actions, and only fails with Karate.
Has anyone experienced the same issue?

EDIT: adding non-karate webdriver payloads provided by Prateek Singh

Request POST http://hub.lambdatest.com /wd/hub/session/719c9157598420fb3e272f53be31ab51/elements  
   { using: 'css selector', value: 'input[type=text]' }

Response 200 POST http://hub.lambdatest.com/wd/hub/session/719c9157598420fb3e272f53be31ab51/elements (461ms)
   {
     sessionId: '719c9157598420fb3e272f53be31ab51',
     status: 0,
     value: [ { ELEMENT: '0.37079523975334916-2' } ]
   }
   
Request POST http://hub.lambdatest.com /wd/hub/session/719c9157598420fb3e272f53be31ab51/element/0.37079523975334916-2/value  
   {
     value: [
       'L', 'a', 'm',  'b',
       'd', 'a', 'T',  'e',
       's', 't', '\n'
     ]
   }

Response 200 POST http://hub.lambdatest.com/wd/hub/session/719c9157598420fb3e272f53be31ab51/element/0.37079523975334916-2/value (1366ms)
   {
     sessionId: '719c9157598420fb3e272f53be31ab51',
     status: 0,
     value: null
   }
Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • I strongly recommend you provide a way to replicate in case there is some gap in standards-compliance. but I have never heard anyone report this so far – Peter Thomas Jan 08 '21 at 15:54
  • I could send you the project I sent to the LambdaTest guys but you need to have a LambaTest account to run the test and see the result for yourself though. Would that do ? – Philippe Antoniotti Jan 08 '21 at 16:08
  • can you or @prateek-singh post the HTTP payload in the case when a non-karate webdriver implementation makes the first requests (especially the one to enter text) – Peter Thomas Jan 09 '21 at 03:08

2 Answers2

1

Try with the latest selenium version, add the following capability:

caps.setCapability("browserstack.selenium_version", "3.141.59");
0

Your remote providers don't seem to be conforming to the W3C spec for chromedriver. For example the response to the /element call should be something like this, I know you have used elements but you can tell that the response "shape" is for the old non-compliant chrome-driver:

3 > POST http://localhost:9515/session/87ff90ad57ad432540b413740a66f7c1/element
3 > Content-Type: application/json; charset=UTF-8
3 > Content-Length: 43
3 > Host: localhost:9515
3 > Connection: Keep-Alive
3 > User-Agent: Apache-HttpClient/4.5.13 (Java/1.8.0_231)
3 > Accept-Encoding: gzip,deflate
{"using":"css selector","value":"#inputId"}

20:59:25.475 [main] DEBUG com.intuit.karate - response time in milliseconds: 9
3 < 200
3 < Content-Length: 88
3 < Content-Type: application/json; charset=utf-8
3 < cache-control: no-cache
{"value":{"element-6066-11e4-a52e-4f735466cecf":"d7bdd4a1-17bc-4ee0-817b-cf7052641d25"}}

And the request to element/value is certainly wrong, this is an example of a spec-compliant request, where the parameter text is expected in the payload (not an array under value):

4 > POST http://localhost:9515/session/87ff90ad57ad432540b413740a66f7c1/element/d7bdd4a1-17bc-4ee0-817b-cf7052641d25/value
4 > Content-Type: application/json; charset=UTF-8
4 > Content-Length: 22
4 > Host: localhost:9515
4 > Connection: Keep-Alive
4 > User-Agent: Apache-HttpClient/4.5.13 (Java/1.8.0_231)
4 > Accept-Encoding: gzip,deflate
{"text":"hello world"}

20:59:25.560 [main] DEBUG com.intuit.karate - response time in milliseconds: 83
4 < 200
4 < Content-Length: 14
4 < Content-Type: application/json; charset=utf-8
4 < cache-control: no-cache
{"value":null}

This must be reason why other browsers are working - perhaps because your LambdaTest setup is using an old version of the chrome-driver. Karate will not support the old version, but we will be happy to fix any gaps vs the W3C standard if applicable.

For reference, these are the capabilities returned by the chrome-driver I used:

{
   "value":{
      "capabilities":{
         "networkConnectionEnabled":false,
         **"chrome":{
            "chromedriverVersion":"87.0.4280.88 (89e2380a3e36c3464b5dd1302349b1382549290d-refs\/branch-heads\/4280@{#1761})",
            "userDataDir":"\/var\/folders\/py\/d2vyrn2n3bz7yzp7rppntw7cvsmbgv\/T\/.com.google.Chrome.JJHuOI"
         },
         "acceptInsecureCerts":false,
         "browserVersion":"87.0.4280.141",
         "browserName":"chrome",
         "platformName":"mac os x",
         "setWindowRect":true,
         "webauthn:virtualAuthenticators":true
      },
      "sessionId":"87ff90ad57ad432540b413740a66f7c1"
   }
}
Peter Thomas
  • 54,465
  • 21
  • 84
  • 248