Karate[Visual studio code]: Setting up karate

Official link:

Step1: Setup using maven:
Note: Depending on the command line tool you use, you need to format the below command.
In the below example I am using GIT Bash, it accepts the multi line command as below.
If you are using windows cmd or other editor which do not support multi line, just remove backslash (\) and format all the steps in one single line command.

mvn archetype:generate \
-DarchetypeGroupId=com.intuit.karate \
-DarchetypeArtifactId=karate-archetype \
-DarchetypeVersion=0.9.5 \
-DgroupId=com.yourcompanyname \
Tool: Git bash

Step2: Import the project in VS Code
– Open VS Code and right click in workspace- add folder to workspace
– This will import the java project

Step3: Run maven install
– Go to terminal and navigate to the newly imported folder in vs code

mvn clean install -U

– This will install all dependencies
– Also it will run default tests which comes as part of the project
– You should see build success.

Step4: Run using Maven

mvn test

Alternatively Use ZIP Release of Karate in VS Code:

Credit: Kalimoh channel






Leave a Reply