Getting "HttpHostConnectException" connection refused while running Karate UI Testcases through jenkins

Viewed 972

I am getting below error while executing testcases through jenkins. jenkin is running on linux slave.

[ERROR] 2020-09-10 03:07:19.692 [ForkJoinPool-1-worker-1] c.i.karate - org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1] failed: Connection refused (Connection refused), http call failed after 1 milliseconds for URL: http://localhost:9222 [ERROR] 2020-09-10 03:07:19.692 [ForkJoinPool-1-worker-1] c.i.karate - http request failed: org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1] failed: Connection refused (Connection refused)

I have written below code for karate UI Automation to launch the chrome browser
Feature: Driver initialization

  Background: 
    * def loginloc = read('classpath:pageobjects/LoginPage.json')

  Scenario: Driver initialization
    * configure driver = {type: 'chrome', showDriverLog: false}
    * driver environment.ScriptEditor.baseurl
    * driver.maximize()
    * retry().waitFor(loginloc.headingtext)
    * driver.waitUntil("document.readyState == 'complete'")
1 Answers
Related