karate

Trying to do some assertion from request, which will be present in response

孤街浪徒 提交于 2020-03-23 14:12:40
问题 I am passing the request as in my feature file and i am trying to do assert from request to response. I have tried must contains queries but i am not sure if i am doing it correct, could you please help. **Background:** * configure headers = read('classpath:merchantServiceheaders.js') Given url MservUrl And path '/spapis/rest/sp-ms-engine/sp/ms/v1/engine/scanandredact' Scenario Outline: ACH Low Value Payment Rips Services Summary ] }*** What i would like to do is assert what i have in my

How to fix - `ERROR com.intuit.karate - http request failed`

て烟熏妆下的殇ゞ 提交于 2020-03-23 12:32:28
问题 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 -

How to launch all Karate features setting up which browser to use as an external maven variable

て烟熏妆下的殇ゞ 提交于 2020-03-23 11:59:20
问题 I was trying to find a way to launch all features in Karate testing through maven using an external variable to set up the browser (with a local webdriver or using a Selenium grid). So something like: mvn test -Dbrowser=chrome (or firefox, safari, etc) or using a Selenium grid: mvn test -Dbrowser=chrome (or firefox, safari, etc) -Dgrid="grid url" With Cucumber and Java this was quite simple using a singleton for setting up a global webdriver that was then used in all tests. In this way I

Getting the maximum value from an array in a JSON response in Karate

房东的猫 提交于 2020-03-16 06:51:26
问题 I have the following Json as a response from a API call { "location": { "name": "London", "region": "City of London, Greater London", "country": "United Kingdom", "lat": 51.52, "lon": -0.11, "tz_id": "Europe/London", "localtime_epoch": 1583594426, "localtime": "2020-03-07 15:20" }, "forecast": { "forecastday": [ { "date": "2020-03-03", "day": { "maxtemp_c": 9, "mintemp_c": 4 } }, { "date": "2020-03-04", "day": { "maxtemp_c": 8, "mintemp_c": 4.1 } }, { "date": "2020-03-05", "day": { "maxtemp_c

Getting the maximum value from an array in a JSON response in Karate

我与影子孤独终老i 提交于 2020-03-16 06:51:07
问题 I have the following Json as a response from a API call { "location": { "name": "London", "region": "City of London, Greater London", "country": "United Kingdom", "lat": 51.52, "lon": -0.11, "tz_id": "Europe/London", "localtime_epoch": 1583594426, "localtime": "2020-03-07 15:20" }, "forecast": { "forecastday": [ { "date": "2020-03-03", "day": { "maxtemp_c": 9, "mintemp_c": 4 } }, { "date": "2020-03-04", "day": { "maxtemp_c": 8, "mintemp_c": 4.1 } }, { "date": "2020-03-05", "day": { "maxtemp_c

Karate: Match array elements of two different JSON

假如想象 提交于 2020-03-03 14:00:00
问题 I have the below two responses, I need to check whether the res1.member.part[0].supportedMembers[*].muid == res2.membersSupported[*].member.muid (order of the elements are not same). Tried out different things but nothing is working out for me. Any help would be greatly appreciated! * def res1 = {"member":{"muid":"MBR1"},"part":[{"PID":"M123"},{"supportedMembers":[{"muid":"MBR3","status":{"code":"A"}},{"muid":"MBR2","status":{"code":"I"}}]}]} * def res2 = {"members":[{"member":{"muid":"MBR2",

Crashed with 'j.l.NullPointerException' when i try to run karate-gatling test reports

馋奶兔 提交于 2020-03-03 07:41:10
问题 I am trying to get some gatling report using karate.gatling project, but i always get the fallowing error. I am using karete version 0.9.3 and gatling-olugin 3.0.1. any idea of what i am doing wrong? 18:38:05.318 [GatlingSystem-akka.actor.default-dispatcher-5] ERROR c.intuit.karate.gatling.KarateAction - 'classpath:com.it.service/service.feature' crashed on session Session(hello,100,1561847885316,Map(),0,OK,List(),io.gatling.core.protocol.ProtocolComponentsRegistry$$Lambda$320/1088104996

Karate framework variable usage

生来就可爱ヽ(ⅴ<●) 提交于 2020-03-03 07:40:48
问题 I have this steps: ... Then status 200 And match response.requests[0].request.url == "/endpoint" And json body = response.requests[0].request.body And match body == { "something": "something"} To simplify, I tried to put response.requests[0].request in a variable called request : ... Then status 200 And def request = response.requests[0].request And match request.url == "/endpoint" And json body = request.body And match body == { "something": "something"} I'm having the following error:

trying to do assertion on SSE type content type

雨燕双飞 提交于 2020-02-28 23:47:21
问题 Scenario: Test * def contentType = 'text/event-stream' * def response = """ <data contentLength="5930" contentType="text/event-stream;charset=UTF-8"><![CDATA[ data: } } This works and asserts correctly but this is contains and i would need to have the value known beforehand And match jsonresponse.data._ contains '00000000000000000000abc' This works and fails correctly but this is contains and i would need to have the value known beforehand And match jsonresponse.data._ contains '123456789' Is

Pass additional parameters to karate-config.js via command line via Maven

蓝咒 提交于 2020-02-20 09:41:05
问题 I have additional settings that I need to pass to Karate when running via Maven that will be available in karate-config.js. Currently I can pass in a string using the karate.env property - is it necessary to encode my parameters as a JSON object and pass them in via this one property or can I do something like: mvn test -DargLine="-Dkarate.env='production' -Dkarate.clientid='1234567890' ... Such that I can then reference karate.clientid in karate-config.js where I can save it into the