A set of real-life examples can be found here: Karate Demos. You could use it for hard-coded absolute paths in dev mode, but is obviously not recommended for CI test-suites. Read the documentation of the stand-alone JAR for more - such as how you can even install custom command-line applications using jbang ! = . Here below is the equivalent of the above, done the hard way: The built-in DockerTarget is a good example of how to: Controlling this flow from Java can take a lot of complexity out your build pipeline and keep things cross-platform. Embedded expressions are useful when you have complex JSON read from files, because you can auto-replace (or even remove) data-elements with values dynamically evaluated from variables. Which suggests that the step should be in the When form, for example: When method post. 3+ years Selenium, Cucumber, BDD, Gherkin Karate or RestAssured framework, Jenkins and SonarCube . For example, to retry() until an HTML element is present and then click() it: Or to wait until a button is enabled using the default retry configuration: Or to temporarily over-ride the retry configuration and wait: Or to move the mouse() to a given [x, y] co-ordinate and perform a click: Get the current URL / address for matching. String interpolation will support variables in scope and / or the Examples (including functions defined globally, but not functions defined in the background). Also look at the section on commonly needed utilities for more ideas. Just write tests in a simple, readable syntax - carefully designed for HTTP, JSON, GraphQL and XML. Karate has great options for re-usability, so once the above JSON is saved as locators.json, you can do this in a common.feature: This looks deceptively simple, but what happens is very interesting. You can do this. Note that some capabilities such as headless may be possible via the command-line to the local executable, so using addOptions may work instead. : * param myparam = 'value' or url: * url 'http://example.com/v1?myparam'. This is one reason why you may want to prefer a flat directory structure as explained above. Make sure you configure your source code management system (e.g. """, """ In the rare case that you need to mutate a Map or List returned from Java but while still within a JS block, use karate.toJson() to convert. get metadata about the currently executing feature within a test, functional-style filter operation useful to filter list-like objects (e.g. Also note that ; charset=UTF-8 would be appended to the Content-Type header that Karate sends by default, and in some rare cases, you may need to suppress this behavior completely. In typical frameworks it could mean changing multiple properties files, maven profiles and placeholders, and maybe even threading the value via a dependency-injection framework - before you can even access the value within your test. For suppressing sensitive information such as secrets and passwords from the log and reports, see Log Masking and Report Verbosity. You can see what the result looks like here. Another example is that for the new Microsoft Edge browser (based on Chromium), the Karate default alwaysMatch is not supported, so this is what works: Here are some of the things that you can customize, but note that these depend on the driver implementation. a JSON array). What is Robot Class in Selenium and How to Use it? For example for web-automation, a / prefix means XPath and else it would be evaluated as a CSS selector. But you can prefix the name with classpath: in which case the root folder would be src/test/java (assuming you are using the recommended folder structure). You could even have all the steps start with When and Karate wont care. PUT method in HTTP is used to update the resources on the server. So the above could be re-written as follows: It is worth repeating that the above can be condensed into 2 lines. The section on Karate Expressions goes into the details. And thats all there is to Karate configuration ! In the post request, instead of giving hard coded value we can give the variable and this is done by embedded expression. The JS API has a karate.signal(result) method that is useful for involving asynchronous flows into a test. To force a null value, wrap it in parentheses: An alternate way to create data is using the set multiple syntax. Note that karate.signal() (described as part of the listen keyword) will be called internally and the listenResult will be the payload contents of the selected message. Before we get to the HTTP keywords, it is worth doing a recap of the various shapes that the right-hand-side of an assignment statement can take: They are url, path, request, method and status. You can see how it can be re-used anywhere to scrape the contents out of any HTML tabular data, and all you need to do is supply the locator that matches the elements you are interested in. It is also very useful when we want to run our feature files with some conditions using tags or we want to run specific feature file, all things are control by TestRunner class. path to file containing public and private keys for your client certificate. So you can use Karate to set-up data via API calls, then run the UI test-automation, and finally again use Karate to assert that the system-state is as expected. You can even chain a submit() to wait for a page load if needed: Since moving the mouse is a common task, these short-cuts can be used: These are useful in situations where the normal click() does not work - especially when the element you are clicking is not a normal hyperlink () or