1

I am trying to run my simple test script into iphone safari or chrome browser but it did not work. i tried to change respective driver, browsername and all but fail. below is my code-

  • def session = {"desiredCapabilities": {"device":"iPhone XS", "browserName":"Safari","realMobile":"true","name":"mobile_iOS","os_version" : "12","browserstack.appium_version":"1.17.0"}} or

  • def session = {"capabilities": {"device":"iPhone XS", "browserName":"iPhone","realMobile":"true","name":"mobile_ios","os_version" : "13","appium_version":"1.17.0","idleTimeout": 120} ,"desiredCapabilities": {"device":"iPhone XS", "browserName":"iPhone","realMobile":"true","name":"mobile_ios","os_version" : "13","appium_version":"1.17.0","idleTimeout": 120}}

  • configure driver = { "type":"safaridriver","webDriverSession": "#(session)", "start": false, "webDriverUrl": "https://<useraccount_key>@hub-cloud.browserstack.com/wd/hub" }

it always gives error "intuit.karate - driver config / start failed: "

I thought it will be due "type":"safaridriver" hence I tried it as "appium", "iOS", "iPhone" but it doesn't work. any workaround

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
santosh
  • 51
  • 4

2 Answers2

1

try with the below snippet as the base and add your browser-stack specific capabilities in the appropriate section,

#snippet internal to karate
* configure driver = 
   """
     { 
       type: 'ios', 
       webDriverPath : "/wd/hub", 
       webDriverUrl: "https://<useraccount_key>@hub-cloud.browserstack.com"
       start: false, 
       httpConfig : { readTimeout: 120000 }
     }
    """
#capability request that will be browser stack service (or anyother grid)
* def desiredConfig = 
    """
     {
       "newCommandTimeout" : 300,
       "platformVersion" : "13",
       "platformName" : "iOS",
       "connectHardwareKeyboard" : true,
       "deviceName" : "iPhone 11",
       "automationName" : "XCUITest",
       "browserName" : "Safari"
     }
    """
# to initiate session
* driver { webDriverSession: { desiredCapabilities : "#(desiredConfig)"} }
Babu Sekaran
  • 4,129
  • 1
  • 9
  • 20
0

The Karate project hasn't tested this. Your best bet is to get help from the BrowserStack team. Note that Karate has an extension system that may be the right solution. But you need to do some digging and research. If that is not possible, please look for some other alternative: https://stackoverflow.com/a/62700642/143475

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • 3
    Thanks for looking into this. it was resolved by adding following desiredcapability-{"desiredCapabilities": {"device":"iPhone 11", "realMobile":"true","name":"rphone11test","os_version" : "14","browserstack.appium_version":"1.17.0"}} – santosh Nov 10 '20 at 14:21