1

I am trying to integrate Karate with Saucelab and I used webDriverSession in the driver config to set up the Saucelab url. Like this ( I used Zelenium with saucelab after reading a few comments earlier )

Using this site to setup zelenium and saucelab https://automationcalling.com/2018/07/09/cross-browser-parallel-automation-test-on-local-remote-and-cloud-using-zalenium/

  • configure driver = { type: chromedriver, webDriverSession : {capabilities : {browserName : 'chrome'}, desiredCapabilities :{ "browserName" : "chrome", "platform": "macOS 10.15", "version": "latest" }}, start : false, webDriverUrl : 'http://localhost:4444/wd/hub'}

I have also tried without Zelenium and the same behavior

  • configure driver = { type: chromedriver, webDriverSession : {capabilities : {browserName : 'chrome'}, desiredCapabilities :{ "browserName" : "chrome", "platform": "macOS 10.15", "version": "94" }}, start : false, webDriverUrl : 'https://username:accesskey:443/wd/hub'}

I can see the session got started in Saucelab and the Url opens up and does the Fullscreen() as well but when it comes for waitFor("locator").input("locator") It fails and does nothing.

Given driver baseUrl * fullscreen() And * waitFor("locator").input("locator")

Does anyone know why the commands are not getting executed in sauce lab ?

Error Session id : enter image description here

url

fullscreen

  • no idea, I suggest you do some research and contribute code. I'll close this question after a couple of days. also refer: https://stackoverflow.com/a/60992292/143475 – Peter Thomas Nov 16 '21 at 02:49
  • Can you send me the session ID or URL for Sauce Labs? We can at least figure out what the commands are that Sauce is seeing. – titusfortner Nov 16 '21 at 22:06
  • Does the command actually execute on the Sauce Labs side? Can you share the command log with us? (PS I see you @titusfortner, you're on leave! Put the Stack Overflow down!) – Dylan Lacey Nov 17 '21 at 02:30
  • Google example (Login and input text on search field ) @titusfortner \"sessionId\": \"bea750a5e4fd49dfa6fff46ab22652f4\" (URL) \"sessionId\": \"bea750a5e4fd49dfa6fff46ab22652f4\" (fullscreen) \"sessionId\": \"bea750a5e4fd49dfa6fff46ab22652f4\" (element) – shivin saraf Nov 17 '21 at 03:49
  • 2
    Sauce is receiving the command to find the input and is correctly returning it (you can see it in your logs with the `ELEMENT` key). Sauce doesn't see any additional commands related to the element. I don't know Karate, but based on the docs (https://github.com/karatelabs/karate/tree/master/karate-core#input) it looks like the first argument in the input method needs to be a locator so maybe Karate is failing because 'Test' isn't a locator? – titusfortner Nov 17 '21 at 17:11
  • @titusfortner I have tried that combination as well where first I wait for the locator and then another step to Input (locator, 'Test') but it still doesn't see input coomand – shivin saraf Nov 18 '21 at 00:52
  • I can't help any more than to say that Sauce is properly responding to the commands received. Someone more familiar with karate will have to help. (PS @DylanLacey you're not the boss of me!) – titusfortner Nov 18 '21 at 15:16
  • @titusfortner. Is javascript commands not honored in Saucelab? – shivin saraf Nov 18 '21 at 21:43
  • Of course they are, but sauce can't execute js it doesn't receive. Your code isn't sending any more commands after locating the element, so you need to figure out where the error is coming from in your code. – titusfortner Nov 18 '21 at 23:32
  • @titusfortner Some good news !! I was able to run tests and it went through all the steps but here is the deal that I can’t pass desired capabilities. * configure driver = { type: chromedriver, start : false, webDriverUrl : 'saucelabdrivercreation url'} but when I add webDriverSession like below it fails configure driver = { type: chromedriver, webDriverSession : {capabilities : {browserName : 'chrome'}, desiredCapabilities :{ "browserName" : "chrome", "platform": "macOS 10.15", "version": "94" }}, start : false, webDriverUrl : I need to pass Tunnel name bc of vpn application. – shivin saraf Nov 19 '21 at 21:41
  • Use the format from the platform configurator: https://saucelabs.com/platform/platform-configurator – titusfortner Nov 20 '21 at 09:54

0 Answers0