karate

Karate UI: driver.location method induces Error: path: $, actual: null

自古美人都是妖i 提交于 2020-01-24 15:09:08
问题 I am trying to use method driver.location, but as a result I got the error : path: $, actual: null My code: Feature: browser automation Background: * configure driver = { type: 'chromedriver', showDriverLog: true } Scenario: try to login to github and then do a google search Given driver 'https://github.com/login' Then match driver.location == 'https://github.com/login' EROR: path: $, actual: null, How to deal with this behavior? 回答1: First make sure you are on the latest RC version 0.9.5.RC4

Integrating Karate with TFS pipeline

故事扮演 提交于 2020-01-16 11:12:09
问题 Build and release system we use is TFS, soon migrating toe Azure Devops. I am trying to introduce an automation framework for contract tests with Karate. Can Karate be integrated with the build jobs in TFS as part of the CI pipeline? 回答1: Karate is a java API test-automation tool that can be implemented using Maven or Gradle. It can be used to run on any CI/CD pipeline using any repository management. Team Foundation Server is both repository management and CD/CD pipeline tools. Please refer

Karate inflates binary file on a post

眉间皱痕 提交于 2020-01-15 10:34:29
问题 I am trying to post a large (16MB) binary file as multipart but the test keeps failing. When debugging using Wireshark (see screenshot) I found out that the payload size as well as the Content-Length are more than 30MB. Any idea what is happening? Here is the code: Given path 'post/large/file' And multipart file 16MB_file = { read: 'file:target/myBinaryFile', filename: 'myBinaryFileName', contentType: 'application/octet-stream' } And header Authorization = 'Basic blablabla' When method post

Karate Gatling - exclude specific request or feature from report

*爱你&永不变心* 提交于 2020-01-15 05:47:49
问题 In karate-config.js I am initially taking the authentication token only once by using callSingle(auth.feature) and this authentication token is being re-used in other feature files. I have users/detail api which I want to performance test using Karate-Gatling. For this I have created a UserSimulation class. This UserSimulation is executing user-detail.feature I have following queries - If possible, how can I completely ignore the auth.feature requests from the generated report. If above

Karate vs Spock

不问归期 提交于 2020-01-13 18:58:50
问题 I've recently found Karate framework for testing Web Services. But there is also Spock framework providing similar ( to my mind ) functionality. What are the differences between the frameworks? I would like to suggest our testers to take a look at it. 回答1: Developer of Karate here. I have only read about Spock but here's my PoV. Karate is laser-focused on testing HTTP web-services, and therefore is designed to manipulate and perform assertions on JSON and XML. As a result - you do not need

How to run Karate and Gatling with Gradle build system

99封情书 提交于 2020-01-13 18:05:21
问题 I'm trying to run a Karate test as a Gatling performance test. My entire setup works perfect when using Maven. I am being forced to use Gradle however. When trying to run under Gradle the below disaster unfolds. Appreciate any ideas what might be causing KarateAction to crash. MyAPI.scala class MyAPI extends Simulation { val protocol = karateProtocol( "/myendpoint" -> Nil ) val action = karateFeature("classpath:org/mycompany/karate/tests/myAPI.feature@test=myTag") setUp( scenario("my-api")

Query parameter handling in karate framework

不打扰是莪最后的温柔 提交于 2020-01-06 07:31:09
问题 Is there any easy way to handle huge query param like below. Also I would like to know how can I do run time parameterisation for some values? http://154.213.196.243:7941/v1/banking/Jumio/callback?callBackType=NetVerifyId&jumioIdScanReference=123abcde-1244-8571-3454-abcd12345567&merchantIdScanReference=66a9ff2e-d8ec-e811-a956-000d3ab3f117&verificationStatus=APPROVED_VERIFIED&idScanStatus=SUCCESS&id+ScanSource=API&idCheckDataPositions=OK&idCheckDocumentValidation=OK&idCheckHologram=OK

karate : Complex JSON Schema matching

て烟熏妆下的殇ゞ 提交于 2020-01-06 02:39:27
问题 I am trying to Validate a complex JSON with Optional keys Following is the complete executable Feature file Feature: Complex Schema Background: * def JSONtobeValidiated = """ { "MyArray": { "MYinternalDetails": [ { "SomeField": "dc", "textfield": [], "OptionalArray1": [ { "Users": "Y", "IsAllowed": "Y" }, { "Users": "Y", "IsAllowed": "Y" } ] }, { "SomeField": "nb", "textfield": [], "OptionalArray2": [ { "CodingP": "GZ", "Name": "Ok" }, { "CodingP": "BO", "Name": "Saved" }, { "CodingP": "YB",

Karate - XML - Printing Child node

为君一笑 提交于 2020-01-06 01:17:07
问题 I need to print a certain child node of my XML which is having multiple child nodes. I have given a sample xml below. But, karate converts to json and prints the data in json format; but i need it to be returned in XML. XML: * def xml = """ <ns4:root xmlns:ns4="http://foo.com" xmlns:ns5="http://bar.com"> <ns4:Test> <ns5:code>123</ns5:code> <ns5:description>My Description</ns5:description> <ns5:SubTest> <ns6:code>345</ns6:code> <ns6:description>Your Description</ns6:description> <ns6

Karate - XML - Printing Child node

不羁岁月 提交于 2020-01-06 01:17:07
问题 I need to print a certain child node of my XML which is having multiple child nodes. I have given a sample xml below. But, karate converts to json and prints the data in json format; but i need it to be returned in XML. XML: * def xml = """ <ns4:root xmlns:ns4="http://foo.com" xmlns:ns5="http://bar.com"> <ns4:Test> <ns5:code>123</ns5:code> <ns5:description>My Description</ns5:description> <ns5:SubTest> <ns6:code>345</ns6:code> <ns6:description>Your Description</ns6:description> <ns6