appiumkaratebrowserstack

Change default Host name "http://localhost:4723" in Karate Framework for mobile automation


I need to update the default Host name/webDriverPath "http://localhost:4723" in Karate Framework for mobile automation.

I am trying to run the mobile script on BrowserStack using webDriverPath as "http://username:passkey@hub-cloud.browserstack.com/wd/hub"

When I am using BrowserStacks webDriverPath, I am getting below error:

It is appending default host name as http://localhost:4723

driver config / start failed: http call failed after 237 milliseconds for url: http://localhost:4723http:/<username>:<passkey>@hub-cloud.browserstack.com/wd/hub/session
org.apache.http.client.ClientProtocolException: URI does not specify a valid host name: http://localhost:4723http:/<username>:<passkey>@hub-cloud.browserstack.com/wd/hub/session,

Solution

  • I think you have to set the webDriverUrl as part of the Karate config, as documented here: https://github.com/karatelabs/karate/tree/master/karate-core#webdriverurl

    You can also look at other answers for tips: https://stackoverflow.com/search?q=%5Bkarate%5D+browserstack