The compiler is looking target folder for the chrome.exe file. In which it is looking for some chrome_1639142447236 file. Actually it is available at C:\Program Files (x86)\Google\Chrome\Application this location.
Below error message I'm getting:
18:51:39.096 [ForkJoinPool-1-worker-3] ERROR com.intuit.karate -
org.apache.http.conn.HttpHostConnectException: Connect to
localhost:9222 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1]
failed: Connection refused: no further information, http call failed
after 4022 milliseconds for URL: http://localhost:9222 18:51:39.098
[ForkJoinPool-1-worker-3] ERROR com.intuit.karate - http request
failed:
Below is the feature level error message:
failed features: src.test.java.examples.users.Sample: Sample.feature:9
driver config / start failed: org.apache.http.conn.HttpHostConnectException: Connect to
localhost:9222 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1]
failed: Connection refused: no further information, options:
{type=chrome, target=null}
If you know where the chrome executable is, please follow the instructions to customize it in your Karate tests: https://github.com/karatelabs/karate/tree/master/karate-core#configure-driver
* configure driver = { type: 'chrome', executable: 'chrome' }
Also read this answer for even more details: https://stackoverflow.com/a/66762430/143475
Related
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'")
Chrome may not be on the Jenkins worker node or it typically will not support a UI test. This is what the Docker container is for. Read the docs: https://github.com/intuit/karate/tree/master/karate-core#dockertarget
We are exploring Karate UI(already using Karate for API testing). For exploring purpose we are using https://www.delta.com/ and its working fine. However have observed following behavior while implementing data driven test
Following is the simple feature file for search destination
Feature: Karate UI POC
Background: To set the browser driver
* configure driver = { type: 'chromedriver', executable: "path to exe"}
* def data=
"""
{
fromDes: '#(from)'
}
"""
Scenario: Launch the application search for the valid flights
Given driver 'https://www.delta.com/'
* driver.maximize()
* waitUntil("document.readyState == 'complete'")
* waitForEnabled('#fromAirportName').click()
* waitForEnabled('#search_input')
* clear('#search_input')
* input('#search_input',data.fromDes)
* driver.quit()
From data.feature file I am making a call to above feature file as follows
* table destinations
| from |
| 'NEW YORK' |
| 'BOSTON' |
* call read('delta.feature') destinations
On executing the test I am getting following error
17:26:55.443 [main] ERROR com.intuit.karate - org.apache.http.conn.HttpHostConnectException: Connect to localhost:9515 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect, http call failed after 2054 milliseconds for URL: http://localhost:9515/session/6fa82b59df1c1c845974c2f52d481d11/url
17:26:55.445 [main] ERROR com.intuit.karate - http request failed:
org.apache.http.conn.HttpHostConnectException: Connect to localhost:9515 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
17:26:55.445 [main] WARN c.i.k.d.chromedriver_1592481370453 - session delete failed:
org.apache.http.conn.HttpHostConnectException: Connect to localhost:9515 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
17:26:55.445 [main] DEBUG com.intuit.karate.shell.Command - closing command: chromedriver_1592481370453
1) However if I remove statement driver.quit() test is working fine.
2) Is it a right approach for data driven testing in Karat UI, as we are using it quit well in Karate API
You don't need to use quit() at all, Karate will do it automatically.
Can you also try with version 0.9.6.RC3
If you still see an issue, follow this process and we will make sure it is fixed: https://github.com/intuit/karate/tree/develop/examples/ui-test
I am using Mac and installed Microsoft Edge but getting this error when I try to run the script. It works fine for Chrome, Firefox and Safari.
* configure driver = { type: mswebdriver, showDriverLog: true}
23:26:42.311 request:
1 > POST http://localhost:17556/session
1 > Accept-Encoding: gzip,deflate
1 > Connection: Keep-Alive
1 > Content-Length: 55
1 > Content-Type: application/json; charset=UTF-8
1 > Host: localhost:17556
1 > User-Agent: Apache-HttpClient/4.5.12 (Java/1.8.0_242)
{"capabilities":{"alwaysMatch":{"browserName":"edge"}}}
23:26:42.321 org.apache.http.conn.HttpHostConnectException: Connect to localhost:17556 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused), http call failed after 10 milliseconds for URL: http://localhost:17556/session
23:26:42.322 http request failed:
org.apache.http.conn.HttpHostConnectException: Connect to localhost:17556 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)
23:26:42.323 driver config / start failed:
org.apache.http.conn.HttpHostConnectException: Connect to localhost:17556 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused), options: {type=mswebdriver, showDriverLog=true, target=null}
shopifysg.feature:10 - driver config / start failed:
org.apache.http.conn.HttpHostConnectException: Connect to localhost:17556 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused), options: {type=mswebdriver, showDriverLog=true, target=null}
Update the Karate-core version greater than 1.1.0 it works
This isn't there on 0.9.5 but it is in the develop branch. You should use msedgedriver, refer: https://github.com/intuit/karate/tree/develop/karate-core#driver-types
I think it is there in 0.9.6.RC1 - so can you try that first. If not, please help us by following the developer guide, so that we can release this sooner: https://github.com/intuit/karate/wiki/Developer-Guide
I've connect mongoDb with SSL & Certs(Trust, Keystore) using Springboot
System.setProperty("javax.net.ssl.trustStore", trustStoreFilePath.getPath());
System.setProperty("javax.net.ssl.trustStorePassword", truststorePassword);
System.setProperty("javax.net.ssl.keyStore", keyStoreFilePath.getPath());
System.setProperty("javax.net.ssl.keyStorePassword", keystorePassword);
Then, able to connect successfully
Then, tried REST call on https://xxxxxx.net/api/v1/login
Added and tried below options
- karate.configure('ssl', true);
- * configure ssl = true
i'm getting below error -
admin_login.feature
21:43:28.106 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target, http call failed after 943 milliseconds for URL: https://xxxxxx.net/api/v1/login
21:43:28.107 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - http request failed:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
21:43:28.114 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - feature call failed: classpath:admin_login.feature
arg: [object Object]
admin_login.feature:8 -
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
21:43:28.116 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate - javascript function call failed:
admin_login.feature:8 -
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
if i'm not connecting db with ssl. able to call all REST calls
Please help on this.
SSL can be tricky, you may need time and patience.
Normally * configure ssl = true should just work in Karate because it will disable certificate validation. Sounds like here you have set some System properties that is being picked up by Karate also. Refer https://github.com/intuit/karate#system-properties-for-ssl-and-http-proxy
So maybe if you use the advanced form of configure ssl you can get it it work.
Remember if are still stuck and you need more support, follow the instructions here: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
I am trying to setup Karate framework for my project. I am getting the following SSLHandshakeException for a simple GET request. I get a proper response when I try the endpoint in the browser, but when I try to run the cucumber feature file I am seeing the following error. I tried configure ssl = true, configure ssl = 'TLSv1.1', but seeing same error
10:35:28.886 [main] DEBUG
org.apache.http.conn.ssl.LenientSslConnectionSocketFactory - Starting handshake
10:35:29.003 [main] DEBUG
org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-0: Shutdown connection
10:35:29.003 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection discarded
10:35:29.003 [main] DEBUG
org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection released: [id: 0][route: {s}-https://hygieia*******.com:443][total kept alive: 0; route allocated: 0 of 5; total allocated: 0 of 10]
10:35:29.004 [main] ERROR com.intuit.karate -
javax.net.ssl.SSLHandshakeException: Received fatal alert:
handshake_failure, http call failed after 446 milliseconds for URL:
https://hygieia******.com/api/dashboard/count
I followed the instructions for jdk8 in javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
I downloaded the mentioned jars (US_export_policy.jar, local_policy.jar) and copied them to {JAVA_HOME}/jre/lib/security and then magic happens 👍
#Peter Thomas Thank you for your help in resolving this issue :)
You are using version 0.6.1 right, I really thought this was fixed. Would be great if you can help me figure what change to make. Here is the ticket that will give you all the info, including code changes: https://github.com/intuit/karate/issues/193
This should work: if you are using karate-apache switch to karate-jersey (or vice-versa) in your pom.xml - most likely it will work.
Worst case, you can set System properties so that the HTTP client will use a certificate you provide, this ticket can give you some hints: https://github.com/intuit/karate/issues/76