Karate Testing Quickstart

Kevin FOO
2 min readJan 1, 2023

I have been trying to automate and chaining POST, GET, PUT API calls with bash curl and ruby curb.

Bash was terrible and involves a lot of coding and files to avoid escaping of special characters like double quote. Migrated to ruby and it got better but still it involves a lot of coding.

I stumble upon Karate Test Automation and it took quite a fair bit of YouTube video tutorials to learn how to use it as there isn’t many text tutorial about it.

To start, I prefer the quick start (https://karatelabs.github.io/karate/#quickstart) where you only need to change groupId and artifactId. For the latest archetypeVersion, best to refer to the official page.

mvn archetype:generate \
-DarchetypeGroupId=com.intuit.karate \
-DarchetypeArtifactId=karate-archetype \
-DarchetypeVersion=1.3.1 \
-DgroupId=com.mycompany \
-DartifactId=myproject

If you do not have mvn installed or perhaps installed but did not configure the PATH for it. Please refer to this article “macOS Install Maven”.

Go into the generated project directory, in my screenshot I used myproject1 and run mvn test . The project should be up and running and all sample test cases should pass.

< Back to all the stories I had written

--

--

Kevin FOO

A software engineer, a rock climbing, inline skating enthusiast, a husband, a father.