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
Related
I have set up API Umbrella in my Ubuntu 20 cloud vm.
Try to access but got 502 Bad gateway like in here:
Obviously, the routing is a failure for some reason.
The output of /var/log/api-umbreall/nginx/current is the following:
2022-09-01T06:08:19.57992 starting nginx...
2022-09-01T06:08:27.48168 2022/09/01 06:08:27 [error] 319#0: *13 [lua] elasticsearch_setup.lua:106: create_aliases(): failed to create elasticsearch index: Unsuccessful response: {"error":{"root_cause":[{"type":"index_already_exists_exception","reason":"already exists","index":"api-umbrella-logs-v1-2022-09"}],"type":"index_already_exists_exception","reason":"already exists","index":"api-umbrella-logs-v1-2022-09"},"status":400}, context: ngx.timer
2022-09-01T06:21:45.17055 2022/09/01 06:21:45 [warn] 318#0: *39756 using uninitialized "x_api_umbrella_request_id" variable while logging request, client: 192.241.213.X, server: mydomain.city, request: "GET / HTTP/1.1", host: "150.230.240.y:443"
2022-09-01T06:32:42.70713 2022/09/01 06:32:42 [error] 318#0: *72162 connect() failed (111: Connection refused) while connecting to upstream, client: 185.14.196.Z, server: mydomain.city, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:14009/", host: "mydomain.city"
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
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 have the glassfish server and I am trying to run the server from netbeans. I am getting the following errors:
WARNING: Cannot start JMX connector JmxConnector config: { name = system, Protocol = rmi_jrmp, Address = 0.0.0.0, Port = 8686, AcceptAll = false, AuthRealmName = admin-realm, SecurityEnabled = false} due to exception java.io.IOException: Cannot bind to URL [rmi://MAZUMDAM4.americas.hpqcorp.net:8686/jmxrmi]: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: MAZUMDAM4.americas.hpqcorp.net; nested exception is:
java.net.ConnectException: Connection timed out: connect]
SEVERE: java.io.IOException: Cannot bind to URL [rmi://MAZUMDAM4.americas.hpqcorp.net:8686/jmxrmi]: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: MAZUMDAM4.americas.hpqcorp.net; nested exception is:
java.net.ConnectException: Connection timed out: connect]
at javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:826)
at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:431)
at org.glassfish.admin.mbeanserver.RMIConnectorStarter.start(RMIConnectorStarter.java:300)
at org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread.startConnector(JMXStartupService.java:297)
at org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread.run(JMXStartupService.java:333)
Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: MAZUMDAM4.americas.hpqcorp.net; nested exception is:
java.net.ConnectException: Connection timed out: connect]
at com.sun.jndi.rmi.registry.RegistryContext.rebind(RegistryContext.java:159)
at com.sun.jndi.toolkit.url.GenericURLContext.rebind(GenericURLContext.java:249)
at javax.naming.InitialContext.rebind(InitialContext.java:427)
at javax.naming.InitialContext.rebind(InitialContext.java:427)
at javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:641)
at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:426)
... 3 more
Caused by: java.rmi.ConnectException: Connection refused to host: MAZUMDAM4.americas.hpqcorp.net; nested exception is:
java.net.ConnectException: Connection timed out: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:341)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at com.sun.jndi.rmi.registry.RegistryContext.rebind(RegistryContext.java:157)
... 8 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:147)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
... 13 more
Now after searching google I came across various suggestions.
a. Checking the firewall. The firewall is not an issue. Because this was working fine just two days ago and it stopped suddenly.
b. Setting the JMX port from the admin console. I did it and it didn't work.
c. Checking the port to see whether it is already used. I checked it. Moreover, I restarted the glassfish server. Even restarted the computer. Nothing changed.
Now I need the help of some wise guys to give some clue in resolving this.
Thanks
start up the domain, get into the admin console.
In the admin console, navigate
Configurations > server-config > AdminService
There is a tab in the main window that is titled "Edit JMX Connector"
The IP address is probably set to "0.0.0.0" (all IP's)
change that to "127.0.0.1"
you MIGHT also need to add an entry in your hosts file
for the domain name in the errror
"mymachine.SOMEDomain.net" or whatever.. so that it resolves to 127.0.0.1.
The underlying problem is
Caused by: java.rmi.ConnectException: Connection refused to host: MAZUMDAM4.americas.hpqcorp.net; nested exception is:
java.net.ConnectException: Connection timed out: connect
during rebind(). See the stack trace. RMI is getting no response at all from that host when attempting to bind a remote object to its Registry. This is a network topology problem or possibly a DNS problem. It should be trying to bind to a registry at 'localhost' only.