var date = new java.util.Date(); For driver type chrome, you can use the addOption key to pass command-line options that Chrome supports: For the WebDriver based driver types like chromedriver, geckodriver etc, you can use the webDriverSession configuration as per the W3C WebDriver spec: Only supported for driver type android | ios. !contains deep is not yet supported, please contribute code if you can. For those who may prefer YAML as a simpler way to represent data, Karate allows you to read YAML content from a file - and it will be auto-converted into JSON. If a handler function (returning a boolean) is provided - it will be used to complete the listen wait if true is returned. This is what is normally expected and simulates a web-browser - which makes it easy to script things like HTML-form based authentication into test-flows. You can also re-use other *.feature files from test-scripts: When a called feature depends on some side-by-side resources such as JSON or JS files, you can use the this: prefix to ensure that relative paths work correctly - because by default Karate calculates relative paths from the root feature or the top-most caller. Note that def can be used to assign a feature to a variable. API testing basics and Karate framework 2. This will create a folder called myproject (or whatever you set the name to). If you have one pre-started, you need to use the playwrightUrl driver config. Note the use of the JavaScript String.includes() function to do a text contains match for convenience. Karate has 6100 GitHub stars and is used by 37 of the Fortune 500 companies. The unified use of Karate test-doubles means that you can script dynamic responses and handle incoming URL, query-string and header variations. Note that the mvn test command only runs test classes that follow the *Test.java naming convention by default. Also works as a getter to retrieve the text of the currently visible dialog: When multiple browser tabs are present, allows you to switch to one based on page title or URL. "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", "C:\Program Files (x86)\Google\Chrome\Application\chrome", 'justinribeiro/chrome-headless', showDriverLog, :9222 --security-opt seccomp=./chrome.json justinribeiro/chrome-headless, 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App', # waitForEnabled() returns an "Element" instance, waitFor('input[name=query]').input('karate-logo.png'), # if you want to get the actual url for later use, "function(e){ return e.innerHTML == 'APPEARED!' That said, there is some benefit to re-use of just locators and Karates support for JSON and reading files turns out to be a great way to achieve DRY-ness in tests. But when you use the visible text-content, for example the text within a