I see the below error when I run my script to retrieve token data using Karate framework -
karate.org.apache.http.conn.HttpHostConnectException: Connection timed out: connect, http call failed after 21407 milliseconds.
Below is the Gherkin syntax written to extract token data -
* configure charset = null
* configure cookies = null
* header Content-Type = 'application/json'
* header Cookie = 'SMSESSION=' + SMSESSION
* header Connection = 'keep-alive'
Given path 'main-controller/v1/tokens'
When request ''
And method POST
And karate.waitForHttp(url)
Then status 200
And def token = response
And print 'NEW GENERATED TOKEN = ' + token
- Please be informed that url and SMSESSSION have been defined already in Background.
I have already tried the below configuration settings -
* configure proxy = 'http://my.proxy.host:8080'
* configure ssl = true
But none of these configurations resolved my issue.
I have even used karate.waitForHttp(url) in my feature file to try and wait for the Token API to respond back. Karate reports show that it waits for 72987 ms but still ends up with the same error again.
Can somebody help me resolve this issue? Thanks in advance!