In this video, we will do 3 API Testing examples with Open Source technologies:
- Functional API Testing with Karate (HERE MAPS API)
- API Performance Testing with Gatling using Karate Scenarios (TESTRELIC.COM)
- Web API Security Testing with Owasp ZAP using Local Proxy
Before starting, You can check this “API Testing and Test Automation with Rest Assured” webinar doc on https://testingbootcamp.com/api-testleri-ve-rest-assured-ile-test-otomasyon-1be1141b6e53
Requirements:
- Java JDK 8 or later
- IntelliJ IDEA
- IntelliJ Plugin — Gherkin
- IntelliJ Plugin — Cucumber for Java
- IntelliJ Plugin — Scala
- Here Maps Developer Account with API Key
Functional API Testing with Karate
- Run “src/test/java/karateFunctional/HereMapsAPITest.feature” file on IntelliJ.
- Open “target/karate-reports/karate-summary.html” file.
API Performance Testing with Gatling using Karate Scenarios
- Check “src/test/java/karateGatling/TestSimulation.scala” file on IntelliJ to review your performance test scenarios.
- Open Terminal or Command Prompt and go to your project’s pom.xml root folder.
- Run This Command “mvn clean test-compile gatling:test”
- Open “target/gatling/testsimulation-xxxxxxxx/index.html”
Web API Security Testing with Owasp ZAP using Local Proxy
- Un-comment 2 lines on your “src/test/java/karate-config.js” file. (SSL & Proxy)
- Open Owasp ZAP and Run your Functional Tests on IntelliJ.
- Check your requests are on the Owasp ZAP screen and you are able to start active scanning using Owasp Zap
GitHub:
Resources:
- https://mvnrepository.com
- https://www.jetbrains.com/idea/download
- https://plugins.jetbrains.com/plugin/7212-cucumber-for-java
- https://plugins.jetbrains.com/plugin/9164-gherkin
- https://github.com/karatelabs/karate
- https://github.com/karatelabs/karate/tree/master/karate-gatling
- https://developer.here.com/develop/rest-apis
- https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/quick-start.html
- https://www.postman.com/
- https://gatling.io/open-source/
- https://www.zaproxy.org/
Youtube Webinar Video: