Sharath Chandran
Sharath Chandran

Reputation: 159

Karate Driver connection refused error while using driver type 'Chrome' and executable batch file pointing to chrome.exe path

Karate Driver Error: org.apache.http.conn.HttpHostConnectException: Connect to localhost:9515 ... failed: Connection refused: During karate script execution on Web testing , the error "poll attempt #1 to #20 for port to be ready - localhost:9515" is displayed.

Note: I am using karate-core-0.9.3.jar and trying to run the example 1 (demo-01.feature) from page :https://intuit.github.io/karate/karate-core/

Background: * configure driver = { type: 'chrome', executable: 'chrome.bat'}

Note: Batch file (chrome.bat) is created and placed in the same location as that of feature file.

Batch file content as below. "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" %*

Upvotes: 3

Views: 2106

Answers (1)

Peter Thomas
Peter Thomas

Reputation: 58058

the same location as that of feature file.

That may not be what is expected. Either make sure that location is in the System PATH or use the full absolute path in the executable. So also try this:

* configure driver = { type: 'chrome', executable: 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe' }

Actually since this is the default, even this should work for you !

* configure driver = { type: 'chrome' }

Read the docs: https://github.com/intuit/karate/tree/develop/karate-core#configure-driver

Finally if you are still stuck, please try the ZIP release: https://github.com/intuit/karate/wiki/ZIP-Release

Upvotes: 2

Related Questions