karate

Assert exists().exists returns assert evaluated to false even locator is available in DOM

折月煮酒 提交于 2020-07-09 11:55:27
问题 First of all Thanks for the Karate-UI. After consuming karate - API, we have started using Karate UI :-) Let me summarize my question here: I am getting 'assert evaluated to false' from the below code: * match text({}header) == 'header' * assert exists({}header).exists The first line of the code able to locate the element and compare the text, the second line throws an error for the same locator. Could you please help me sort out this problem? 回答1: Can you try 0.9.6.RC3 - we realized exists()

How to pass x-www-form-urlencoded - grant_type=client_credentials in Karate

人盡茶涼 提交于 2020-07-03 10:00:10
问题 How to pass x-www-form-urlencoded - grant_type=client_credentials in Karate. Hi, I am trying to pass value grant_type=client_credentials in the form of x-www-form-urlencoded in karate which i was doing with postman. i know karate will default set the content type as x-www-form-urlencoded, but can u help what i am doing wrong here? Karate script: enter code here Given url 'http://env/singlesignon/v1/access/token' And header Authorization = 'Basic

CSRF TOKEN and cookies having JESSION ID are not passed to different scenario in the karate

ぐ巨炮叔叔 提交于 2020-06-28 08:32:48
问题 Scenario 1: url: path1 Method : POST Headers Accept Content-Type Form fields: Username Password url: path2 Method:get Headers Accept Content-Type Output of path2 is CSRF TOKEN and cookies having JESSION ID Scenario2: For calling any path in scenario 2 we need to pass the path2 outputs which is CXRF TOKEN and JSESSIONID Problem: For our test cases we need to always pass the jsession id(this jession id should be taken from the path2 only) and csrf token from path2 to all the subsequent calls.

How to set a dynamic value for a json array in Karate

*爱你&永不变心* 提交于 2020-06-26 12:24:58
问题 i have a json file, which needs uniq values for each post request. uniqId = '55555'. for all the uniq ids i need to pass same uniqId. so far i was able to only set for only the endtoEndid. unable to set for invoiceNum and txnValue. Please help. so far i have done following: eval req = {"endtoEndid":"", "prgrmId":"2344", "invoices": [ { "invoiceNum":""}], "currency":5.99, "txnRefs": [ { "txnId":"name", "txnValue":""},{ "txnId":"state", "txnValue":"illinois"}]} eval req['endtoEndId'] =

How to pass post request parameters dynamically to get request in Karate

[亡魂溺海] 提交于 2020-05-31 05:41:21
问题 How do I pass a value of one API attribute to another API while automating in Karate? I have a POST request which when submitted will generate an id in the response, and I pass that id dynamically to the upcoming GET request. I have already tried writing an Java method to read and write but it doesn't work. 回答1: Please forget about Java for a moment, Karate is very different ! For you I suggest you do this. Use the ZIP Release: https://github.com/intuit/karate/wiki/ZIP-Release There is a

How to use form fields in the same order for Amazon S3 upload file using presigned url

时光怂恿深爱的人放手 提交于 2020-05-31 04:17:29
问题 I have a postdata presigned URL of Amazon S3. I want to use it in a Karate feature file to upload a file (say: pdf) Here is a sample Curl request that I need to perform Using Karate POST request curl --location --request POST '<s3bucketURL>' \ --form 'key=some_key_fileName' \ --form 'x-amz-meta-payload={JsonObject}' \ --form 'Content-Type=application/pdf' \ --form 'bucket=<BucketName>' \ --form 'X-Amz-Algorithm=AWS4-HMAC-SHA256' \ --form 'X-Amz-Credential=<AWS_Credential>' \ --form 'X-Amz

How to use form fields in the same order for Amazon S3 upload file using presigned url

我怕爱的太早我们不能终老 提交于 2020-05-31 04:16:53
问题 I have a postdata presigned URL of Amazon S3. I want to use it in a Karate feature file to upload a file (say: pdf) Here is a sample Curl request that I need to perform Using Karate POST request curl --location --request POST '<s3bucketURL>' \ --form 'key=some_key_fileName' \ --form 'x-amz-meta-payload={JsonObject}' \ --form 'Content-Type=application/pdf' \ --form 'bucket=<BucketName>' \ --form 'X-Amz-Algorithm=AWS4-HMAC-SHA256' \ --form 'X-Amz-Credential=<AWS_Credential>' \ --form 'X-Amz

How to use 'faker' libraries in karate framework?

杀马特。学长 韩版系。学妹 提交于 2020-05-31 02:07:48
问题 I'd like to use the 'faker' library to generate fake data in JSON file as below. In karate-config.js, I do the following: var faker = require('faker'); In sample.json: { 'firstName': '#(faker.name.firstName)' 'city' : '#(faker.address.city)' } But I'm getting error like 'unable to find 'require' keyword in 'karate-config.js' Please help on this. 回答1: Karate does not support NPM or the require keyword. For complex custom logic, the recommendation is to use Java interop. My suggestion is you

How to use 'faker' libraries in karate framework?

China☆狼群 提交于 2020-05-31 02:06:50
问题 I'd like to use the 'faker' library to generate fake data in JSON file as below. In karate-config.js, I do the following: var faker = require('faker'); In sample.json: { 'firstName': '#(faker.name.firstName)' 'city' : '#(faker.address.city)' } But I'm getting error like 'unable to find 'require' keyword in 'karate-config.js' Please help on this. 回答1: Karate does not support NPM or the require keyword. For complex custom logic, the recommendation is to use Java interop. My suggestion is you

KarateDSL UI Testing - Friendly Locators not working

僤鯓⒐⒋嵵緔 提交于 2020-05-30 08:18:23
问题 Following the other question that I raised recently, could you guys help spot what is wrong with the way how I wrote the "below" friendly locator? Thank you in advance! Scenario: Get UI - Download Given url 'https://test01/v1/doc/env/ And headers headers1 When method get Then status 200 * def env = response.url Given driver env And click('{button}Proceed') And click('{span}Start') And click('{span}Required - GSA) And click('{span}Required - GSB') And click('{span}Required - GSC') And click('