UI Test Automation Made Simple.
Karate’s standards compliant web-browser automation framework takes the pain out of UI automation and brings the fun back into your testing.
With a simple, carefully designed syntax that solves the challenges of flaky tests and waiting for elements to appear – Karate has been embraced by teams across the world.
Built upon the rock-solid foundation famous for API testing, Karate for UI automation has capabilities built-in such as assertions, tagging, comprehensive HTML reports and being able to run tests in parallel. You can mix and match API testing and UI testing within the same test flow and more effectively test your architecture. Get started in minutes using the IDE plugins and no programming experience is required.
W3C WebDriver, Chrome DevTools
Switch between browsers with just config
Wait for elements, powerful API
Use Docker or cloud- based grids
Self-hosted, local and low-latency
Assertion and Reports
Built-in along with tags, config and env. switching
API and UI testing within same test
- Simple, clean syntax that is well suited for people new to programming or test-automation
- All-in-one framework that includes parallel-execution, HTML reports, environment-switching, Visual Testing, and CI integration
- Cross-platform - with even the option to run as a programming-language neutral stand-alone executable
- Support for iframe-s, switching tabs, multiple URL domains, and uploading files
- No need to learn complicated programming concepts such as “callbacks”, “async/await” and “promises”
- Option to use wildcardand “friendly” locatorswithout needing to inspect the HTML-page source, CSS, or internal XPath structure
- Chrome-native automation using the Chrome DevTools Protocol(equivalent to Puppeteer)
- W3C WebDriver support built-in, which can also use remote / grid providers
- Cross-Browser support including Microsoft Edge on Windowsand Safari on Mac
- Playwright support (experimental) for even more cross-browser and headless options, that can connect to a server or Docker container using the Playwright wire-protocol
- Parallel execution on a single node, cloud-CI environment or Docker- without needing a “master node” or “grid”
- You can even run tests in parallel across different machines-and Karate will aggregate the results
- Embed video-recordings of testsinto the HTML report from a Docker container
- [experimental] Android and iOS mobile support via Appium
- Seamlessly mix API and UI tests within the same script, for example sign-in using an APIand speed-up your tests
- Intercept HTTP requests made by the browser and re-use Karate mocksto stub / modify server responses and even replace HTML content
- Use the power of Karate’s match assertions and core capabilitiesfor UI assertions
- Simple retryand wait strategy, no need to graduate from any test-automation university to understand the difference between “implicit waits”, “explicit waits” and “fluent waits” :)
- Simpler,elegant, and DRY alternative to the so-called “Page Object Model” pattern
- Carefully designed fluent-APIto handle common combinations such as a submit()+click()action
- Elegant syntax for typical web-automation challenges such as waiting for a page-loador element to appear
- Compose re-usable functions based on your specific environment or application needs
- Comprehensive support for user-input types including key-combinations and mouse() actions
- Step-debug and even “go back in time” to edit and re-play steps - using the unique, innovative Karate Extension for Visual Studio Code
- Traceability: detailed wire-protocol logs can be enabled in-line with test-steps in the HTML report
- Convert HTML to PDF and capture the entire(scrollable) web-page as an image using the Chrome Java API
To understand how Karate compares to other UI automation frameworks, this article can be a good starting point: The world needs an alternative to Selenium - so we built one.
- Example 1 - simple example that navigates to GitHub and Google Search
- Example 2 - simple but very relevant and meaty example (see video) that shows how to
- wait for page-navigation
- use a friendly wildcard locator
- wait for an element to be ready
- compose functions for elegant custom “wait” logic
- assert on tabular results in the HTML
- Example 3 - which is a single modular script that exercises all capabilities of Karate Driver
- a handy reference that can give you ideas on how to structure your tests
- run as part of Karate’s regression suitevia GitHub Actions
Mobile / Appium
Please consider Mobile support as experimental. But we are very close and there are some teams that use Karate for simple use-cases. Please contribute code if you can.
- Refer to this example project
Please refer documentation for details on Configuration, Concepts and more.