Questions tagged [karate-call-single]

26 questions
2
votes
1 answer

Karate framework-form-data

-cURL code snippet curl --location --request POST 'http://smartdoc-apac-documentservices-dk1174-b.uku1f.paas.intranet.db.com/fn/createCaseMgmtDocument' --form 'file=@"RCH_15CA.pdf"' --form 'docServiceInputJson="{ "strMimeType":…
1
vote
1 answer

How to get chrome browser network laps logs in karate UI automation

As part of Oath 2.0 client credential (response type code and ,microsoft SSO) automatio , I need to retreive token from the browser logs (from n/w tabs or response headers) that bearer token can be used in the subsequent API request n I am using …
1
vote
1 answer

Karate Gatling callonce/callsingle

Here is a simple test that I am trying to run: Background: * def newCatReturned = karate.callSingle('./generate-cat-payload.feature') Scenario: Create a new cat * print '*** Cat : ', newCatReturned.cat Given path '/cats' And…
1
vote
0 answers

How to continue execution after 1 scenario gets failed in Karate. Already tried with try catch but no luck

I am using karate and i have a problem statement like i want to continue execution even if a error/exception comes. I am using Karate forEach for the same, below is the sample code which i am using: def fun = """ function() { try…
1
vote
0 answers

I am trying to make a javacript function which will upload a file to a S3 bucket and invoke the function from karate feature file

I am tried to create a JS function which will upload a file in S3 bucket and then invoke that function from a karate feature file. But I am getting an error whatever i try to do. js failed: >>>> 01: read('D:\Personal\NTB…
1
vote
1 answer

How to generate the json array dynamically based on the Input Array - language wise

Question on JSON Transformation I have a request JSON object as follows: def request = { "Items": [ { "id": "151", "optionNumber": 1, "ListItems": [ { "language": "en", "value": "Aruba" }, …
Shreyansh Jain
  • 498
  • 4
  • 7
1
vote
1 answer

karate does not return all variables that were defined (using def) in the 'called' feature

I have the following file karate-config-test.js function fn() { var env = karate.env; // get system property 'karate.env' var baseUrl = "http://localhost:5000" var config = { env: env, baseUrl: baseUrl }; //open connection to…
Rachid G
  • 190
  • 1
  • 7
1
vote
0 answers

How to send Authorization parameters to Karate Framework

I need to send this parameters to Karate Framework, and I don't fine how to do it enter image description here Scenario: Stress ordenes en tiendas Given path 'validation' When method Get Then status 200 I need some help to send this information to…
Margra
  • 11
  • 1
1
vote
0 answers

assigned variables not getting populated in feature file Intellij

I'm calling a feature file like this - Eg. def acctNum = db.results[0].XXX def retCustMod = call read('classpath:features/core/xxx.feature') {entityId: #(acctNumS),modeOfPayment: #(modeOfPay), amountValue: #(flowAmt), execstartdt: #(execstartdt),…
Prathamesh
  • 11
  • 1
1
vote
0 answers

How to apply call read function in if-else or ternary operator construction in Karate framework

How to use conditions if-else or ternary operator in Karate framework and determine ether feature file will continue execute a current script or break(stop) with a specified message? I have tried a following script: At the begining of the scenario…
Donald D
  • 11
  • 1
1
vote
1 answer

Repeating and looping API calls in Karate framework

I am new to Karate framework and have written the following working code to run few sample API tests. Feature: Sample API Tests Background: * def request_headers = {apikey: "#(apikey)", Content-Type: 'application/json'} * configure…
Rajeev HV
  • 13
  • 3
1
vote
0 answers

Karate 'if' combined with with 'karate.call' statement is not calling the feature file correctly

The 'if' condition in karate to match two json strings is not returning the correct result. I tried matching two jsons both with same structure as below in an if condition, and wanted to call a java method if the test condition fails: { …
Baskar
  • 21
  • 2
1
vote
1 answer

Karate UI - How to do for each in Karate for list of WebElements

def dropdownBtn = locate("//div[starts-with(@class,'DropdownWidget')]/descendant::span") dropdownBtn.click() delay(8000) def dropdownOptions = locateAll("//li[@role='option']") Then karate.log('Number of dropdown options: ' +…
1
vote
0 answers

how to run the specific steps after the scenario completion always even though test passes or fails?

In Karate Framework, how to run the specific steps after the scenario completion always even though test passes or fails? how to run the specific steps after the scenario completion always even though test passes or fails?
Shreyansh Jain
  • 498
  • 4
  • 7
1
vote
1 answer

callSingle throwing exception - Karate framework

Getting callSingle() cached result is an exception. Here login feature calling basic-auth.js in background which provides basic auth and login endpoint returns bearer token in response. Whenever tried to call feature file with callSingle its…
Sachin
  • 11
  • 3
1
2