Karate API call errors out with http call failed after 2255 milliseconds for url post upgrade from 0.9.6 to 1.0.1 [duplicate] - upgrade

This question already has an answer here:
Karate HTML parsing throwing SaxException when document begins with lower-case <!doctype
(1 answer)
Closed 1 year ago.
My tests were written with karate 0.9.6 and now I am in the process of fixing some of the failed tests after upgrade to 1.0.1.
I am unable to get around this one failure though
Error as per summary html: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 3; The element type "hr" must be terminated by the matching end-tag ""., http call failed after 2255 milliseconds for url:
at the when method GET of my API call.
Anyone else seen this before? Which xml file is it referring to here?
Thanks,
NT

Looks like one of your requests simply failed and the server returned HTML. It can be a bug, so please follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
Also see in case this is the reason: https://github.com/intuit/karate/issues/1706

Related

Karate to Java call errors out with TypeError post upgrading from 0.9.6 to 1.0.1 [duplicate]

This question already has answers here:
Karate Custom Serialiser for Java Return Value
(2 answers)
Closed 1 year ago.
My tests were written with karate 0.9.6 and now I am in the process of fixing some of the failed tests after upgrade to 1.0.1.
Calling a Java function using obtained api response raises an error.
Sample call in karate: obj.matchName(apiResponse, rName)
Sample Java method:
public String matchName(JSONObject apiResp, String name) throws Exception {
try { }
catch (Exception e) { }
finally { }
}
Error received:
obj.matchName(apiResponse, rName)
<<<<
org.graalvm.polyglot.PolyglotException: TypeError: invokeMember (matchName) on Utilities#a1b7549 failed due to: Cannot convert ''(language: Java, type: com.intuit.karate.graal.JsMap) to Java type 'net.minidev.json.JSONObject': Unsupported target type. - .:program(Unnamed:1)
This used to work well before the upgrade, could you please let me know how to handle this change with upgrade?
TIA
NT
Karate never supported JSONObject, if it used to work - you were just lucky - so please read the docs: https://github.com/intuit/karate#calling-java
So use a Map, List or String as parameter types.
If you are still stuck, follow the process - and note that old versions are not supported - as of now, the latest is 1.1.0: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

SOAP API Automating testing with ROBOTFRAMEWORK

Good day,
I am trying to use robot framework to test a soap based api. I tried using the RobotFramework-Soap library first. I tried a sample case and it works but as soon as I put in my api link it does not work. Im not sure if it is because my api link contains an api.
N.B. due to confidentiality I am unable to post the actual api link. But it is in the format shown below.
*** Settings ***
Library SoapLibrary
Library OperatingSystem
*** Test Cases ***
Example
Create Soap Client http://000.000.000.000:8000/SomeService?wsdl
${response} Call SOAP Method With XML ${CURDIR}/request.xml
${text} Get Data From XML By Tag ${response} AddResult
Log To Console ${text}
Save XML To File ${response} ${CURDIR} response_test
When I run the above test. It fails with following error:
ConnectionError: HTTPConnectionPool(host='xxx_cert', port=8000): Max retries exceeded with url: /SomeService?xsd=xsd0 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
I even tried using the suds library as well. and when i do a simple test as follows:
***Test Cases***
Example
Create Soap Client http://000.000.000.000:8000/SomeService?wsdl
I get the following error: URLError: urlopen error [Errno 11001] getaddrinfo failed
I did some searching and I found that it could be related to the port. But Im not sure how to resolve this issue.
Any assistance would be greatly appreciated.
Thanks,
Lee
The solution was to edit the local host file to cater for the web service. That seemed to solve all the problems.

Io Language : Exception: Object does not respond to 'URL'

Today I'm exercising an Io example of "seven language of seven weeks."
Example code:
futureResult := URL with("http://google.com/") #fetch
writeln("Do something immediately while fetch goes on in background...")
writeln("This will block until the result is available.")
writeln("fetched ", futureResult size, " bytes")
Running with exception:
Io$ io future.io
Exception: Object does not respond to 'URL'
---------
Object URL future.io 1
CLI doFile Z_CLI.io 140
CLI run IoState_runCLI() 1
Directly run URL in io with following error:
~$ io
Io 20110905
Io> URL
Exception: Object does not respond to 'URL'
---------
Object URL Command Line 1
Io>
My environment is:
Ubuntu 14.04
Followed post , I have done following:
$ sudo apt-get install libevent-dev
$ ./build.sh
$ ./build.sh install
URL error is fixed.
But following error thrown:
Do something immediately while fetch goes on in background... This
will block until the result is available. fetched Exception: Error
does not respond to 'size' --------- Error size
future.io 6 Error size future.io 6 CLI
doFile Z_CLI.io 140 CLI run
IoState_runCLI() 1
Post help to install Io
For anyone else like me who is years later running into this issue (or any other "Exception: Object does not respond to X" issue) while following along with Bruce Tate's Seven Languages in Seven Weeks, the solution may be this:
There are some Objects/libraries which seem like they would be included in core Io based on the documentation, but are not. You must install them as addons with eerie.
To do so, follow the instructions here. Basically, you have to look for the correct addon under the IoLanguage group on Github, and install it.
This particular issue with the URL Object is further complicated by a couple of problems I will expound upon below.
There is no addon for URL, instead the functionality for URL is covered by an addon called Socket (located here.)
To get eerie to install Socket, you first need to install something called libevent. I did this by going to the libevent website, downloading the most recent stable version, extracting the files to a directory, and then following the instructions on how to build libevent with CMake on the libevent github page.
The Socket object seems to not have support for https. The number of websites that still use http is dwindling. Google, the website used in the example in Seven Languages in Seven Weeks, moved away from http years and years ago. The first website I was able to come across that still uses http is a Chinese news website, but you can find other examples by googling around for "Websites still using http."
After accounting for all of these issues, I finally got my version of the code to work.
url := URL with("http://xinhuanet.com/")
// Had to find a website still using http, https is unsupported by Socket.
futureResult := url #fetch
// Moved this call to own line for personal clarity
writeln("Do something immediately while fetching.")
writeln("The below statement will block until the result is available.")
writeln("fetched ", futureResult size, " bytes") // Blocks until complete
And my output looks like:
Do something immediately while fetching.
The below statement will block until the result is available.
fetched 99992 bytes

Warning: curl_setopt() [function.curl-setopt]: Invalid curl configuration option in facebook_base.php

A week ago I started to notice a problem with the php sdk file - facebook_base.php
sometimes when connected facebook member visit the site and the auto-login trigger I get 2 errors and sometimes only the first error (that is why I used it in my problem title)+ the site shows up but without showing that user is connected.
after a refresh no error is shown and the site for connected member shows up.
I've tried new version of php API and also old ones that worked and still problem remained.
any ideas what can cause the problem?
UPDATE: similar problem spotted here: https://developers.facebook.com/bugs/207087046099691?browse=search_512a0e37e7ecf6136191651
this is the errors:
Warning: curl_setopt() [function.curl-setopt]: Invalid curl configuration option in /home/admin/domains/mydomain.com/public_html/includes/base_facebook.php on line 970
Warning: curl_setopt_array() [function.curl-setopt-array]: Array keys must be CURLOPT constants or equivalent integer values in /home/admin/domains/mydomain.com/public_html/includes/base_facebook.php on line 946

Wicket warning allow_url_include=On

From time to time I get the following warning in the logfile of my Wicket application:
04.10.2012 14:52:08,525 WARN [org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper]
Unknown listener interface 'd allow_url_include=On '
What does that mean and how do I fix it? I tried Google, but I could only find results for the PHP configuration allow_url_include.
I'm using Wicket 6.0.0
Most likely an automated tool tries to exploit some PHP application. Wicket can't handle this request and prints the warning. Look in the access log what HTTP requests hit your server at this timestamp to see which request caused this warning.
It's safe to ignore this warning in this case.