How can I define proxy settings in karate-config.js file? [duplicate] - karate

This question already has an answer here:
Karate DSL: Getting connection timeout error
(1 answer)
Closed 1 year ago.
I'm trying with Karate behind my office network which is using proxy. But the configure statement didn't work. In home network. it works perfectly fine.
The configure statement : didn't work for our proxy. karate.configure('proxy', 'https:/my.proxy.host:8080');

As you can see from these issues #502 and this other Stack Overflow question, this works for others. So you will have to figure this out and it will help everyone if you debug this on the Java side if possible. Maybe you are missing authentication for your environment.
You can try switching to karate-jersey from karate-apache or vice-versa and see if that changes anything. Else unless you provide a way to replicate, we can't help - but this is indeed difficult for a proxy: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Related

Pact-Net Provider Testing - Fundamental question

I have a fundamental question. I cannot figure out how to get the MockServer to log (like outlined in this inquiryPactNet - HttpPost Test Fails with 500 internal server error ). If I had that information I may be able to determine my problem. How was that enabled?
I am running Net 6, using the Pact-Net NuGet libraries and PactBuilderV3
I am running into the same issue as the above question link. I cannot Post or GET with a body in my consumer tests.

Karate WebSocket connection failed due to extension negotiation error [duplicate]

This question already has an answer here:
How can I integrate socket.io on Karate
(1 answer)
Closed 1 year ago.
Got the following exception when connecting to a WebSocket server with karate.webSocket():
org.graalvm.polyglot.PolyglotException: karate.io.netty.handler.codec.CodecException: invalid WebSocket Extension handshake for "permessage-deflate; server_no_context_takeover; client_no_context_takeover"
- com.intuit.karate.http.WebSocketClient.<init>(WebSocketClient.java:144)
- com.intuit.karate.core.ScenarioEngine.webSocket(ScenarioEngine.java:731)
- com.intuit.karate.core.ScenarioBridge.webSocket(ScenarioBridge.java:861)
The server response has the header
Sec-WebSocket-Extensions: permessage-deflate; server_no_context_takeover; client_no_context_takeover
According to the spec https://www.rfc-editor.org/rfc/rfc7692#section-7.1.1.1, a server may include this in the response header.
Tried to specify the same header in the options but still failed.
Is there a way to work around this?
It certainly can be a case we don't support yet. It would be great if you can follow this process and hopefully you can find a public end-point to simulate or try to create a local way - ideally via java / netty or you can use some JS lib etc if that's more convenient.
Instructions: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
Of course if you can also provide pointers or a PR, nothing like it. Here is an example of a similar conversation in the past: Is there a way to use custom headers when opening WebSocket connection?

Testlink Jenkins result integration not working

I want to sync automation result from jenkins to testlink. I tried with Testlink -jenking plugin and testlink-api-client but not worked getting error.
Pre-setup :
$tlCfg-> api-> enabled
$tlCfg-> exec_cfg-> enable_test_automation
From Testlink UI enable automation for the project.
Test code :
TestLinkAPIClient testlinkAPIClient = new TestLinkAPIClient(APIKEY, "http://localhost/testlink/lib/api/xmlrpc/v1/xmlrpc.php");
testlinkAPIClient.reportTestCaseResult(Project, TestPlan, TEST_CASE, Build, notes/comments, teststatus);
output :
"testlink.api.java.client.TestLinkAPIException: The call to the xml-rpc client failed.".
References used :satishjohn.wordpress.com
2. softwaretestinghelp.com
and other stackoverflow threads.
I browsed and try out defined steps from some of the blogs but still facing same issue?. Can anyone help me to resolve this issue or other approach on sync result with testlink ?.
I believe you should follow the documentation(1) written by kino who wrote the plugin.We recently managed to sync automation results from Jenkins to Testlink by following above doc.Our auto tests were written based on testng framework, Hence we used "testng-results.xml" and TestNg method name based result seeking strategy.
We didn't come across an issue as you mentioned. From (2) and (3) you can get the plugin source .My advice is to debug the code after enabling the debug on Jenkins hosted tomcat server. So you can find the actual cause of the issue by yourself.
Reference:
(1) https://wiki.jenkins-ci.org/download/attachments/753702/jenkins.pdf
(2) https://github.com/jenkinsci/testlink-plugin
(3) https://github.com/kinow/testlink-java-apienter code here
You can run wireshark and filter on port "tcp port http" to see exact error you get from the server. When it was not working for us we were getting 200 OK with text "XML-RPC server accepts POST requests only."
You can also check /var/log/apache2/error.log for testlink errors.
We fixed the issue by setting following config in config.inc.php and restarting apache.
$tlCfg->api->enabled = TRUE;
$tlCfg->exec_cfg->enable_test_automation = ENABLED;

Kaazing is not working with SSL setup

I have a basic kaazing setup for stomp and its working fine with my webpage which is served up using http.
Now I want to connect using SSL (HTTPS) and I've changed all the settings on my web server to do so.
Since I did that, browser was not happy making a HTTP (unsecured) connection to Kaazing (I'm fine if there is way around it to just make kaazing work without https as well) and now I'm trying to setup ssl for Kaazing as well. I just appended an 's' to everything and changed tcp: to ssl:. also, generated a keystorefile with my servername.
Still in the browser I'm able to reach
https://servername:8000/jms/;e/ct?.kn=6433810530520803
this is the first file Kaazing libraries are trying to reach and the response to this is
https://servername:8000/jms/;e/ut/qJA49SDjQEHLINJVoWe5fHGZqpUYqe6e?.kn=6433810530520803
https://servername:8000/jms/;e/dt/qJA49SDjQEHLINJVoWe5fHGZqpUYqe6e?.kn=6433810530520803
2 more javascript files I'm assuming. But these files are not reachable, getting 404
I understand the question is little vague, please feel free to ask more details if you need. But if anybody has any idea whats going on and whats wrong, please let me know. I would really appreciate the help.
Have no clue how to debug this Kazzing thing nor Websocket connections.
Also Not that I'm trying to setup a internal ip-hop based on this document.
Here is my complete gateway-config.xml
Anand,
You have configuration issue. Let me explain it here:
<service>
<accept>wss://servername:8000/jms</accept>
<type>stomp.jms</type>
<properties>
<connect>tcp://localhost:61613</connect>
<connection.factory.name>ConnectionFactory</connection.factory.name>
<context.lookup.topic.format>dynamicTopics/%s</context.lookup.topic.format>
<context.lookup.queue.format>dynamicQueues/%s</context.lookup.queue.format>
<env.java.naming.factory.initial>org.apache.activemq.jndi.ActiveMQInitialContextFactory</env.java.naming.factory.initial>
</properties>
<accept-options>
<wss.bind>10.171.131.100:8000</wss.bind>
</accept-options>
<cross-site-constraint>
<allow-origin>https://23.23.23.23:80</allow-origin>
</cross-site-constraint>
<cross-site-constraint>
<allow-origin>https://servername:80</allow-origin>
</cross-site-constraint>
</service>
Note the last cross-site-constraint, it is https://servername:80 . This won't work. it should be http:servername:80 or https://servername:443 (if you have configured ssl correctly). This explains "2 more javascript files I'm assuming. But these files are not reachable, getting 404".
Alternately, you can relax the cross-site-constraint by putting the following:
<cross-site-constraint>
<allow-origin>*</allow-origin>
</cross-site-constraint>
Once you have it working and your deployment scenario is solid, limit the access by putting a tighter cross-site-constraint.
Hope that helps. Give it a try and update this thread.

Connector/c++ with SSL?

How to connect to MySql using Connector/c++ over SSL?
I read about mysql_ssl_set(): seems to work only with Connector/c.
I have openSSL enabled and working for require SSL users on MySql. And I can connect remotely to MySql using Connector/c++, but cannot see how to modify parameters of sql::Connection to reference certs for SSL.
Excellent tutorial from Giri Mandalika at MySql DevZone and docs on Connector/c++ don't mention SSL, which surprised me because SSL is well documented for Connector/c...or did I miss something obvious?
I realize sql::Driver::Connect() is overloaded, with the less-commonly discussed method taking one parameter sql::ConnectOptionsMap &options. Following that trail, I found just one discussion on point: Ulf Wendel/Thomas Pollak question-and-solution here (http://forums.mysql.com/read.php?167,367519,369534#msg-369534).
Did not work for me: when I incorporated it and tried to build (VC2008, WIN7) the build had warnings and failed.
I traced the exact causes as:
sql::ConnectPropertyVal generates locally defined symbol warning; and
std::map causes fatal error LNK1120: 1 unresolved externals.
With so many users out there of Connector/c++, I hoped others in the community might also be interested in how to use SSL with Connector/c++. Appreciate any ideas or help.
Spoke to Giri Mandalika (on the original development team), who mentioned that SSL support was originally planned but not completed for Connector/c++.
In case others who want SSL find this question, I worked around the problem only by using Connector/c, the underlying C api which Connector/C++ was designed to wrap.
As more than six months have elapsed without any community member coming up with a specific solution to use SSL with Connector/c++ (other than the overload solution referenced in my question), I guess I have to conclude that it just isn't possible, and mark my own question as "Answered" by me.