askeledz / java_selenium_restapi

Selenium - REST API - JMeter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Toptal project

  • The project consists three different modules (UI, REST API & Load test)
  • Runs tests using TestNG and Jmeter
  • To drive the browsers (e.g. Chrome) it's used Selenium WebDriver
  • Tests can be executed locally or remotely using Jenkins CI server
  • Project is created on MacBook Pro (macOS, Mojave)

Importing Project (IntelliJ IDEA)

  • Import Project --> Select project root dir --> Import project from external model - Maven (leave everything by default)
  • This is Maven project and you should import dependencies (Use Auto import).

JMeter - prerequisites on Jenkins Server

  • Download and Install Apache JMeter 5.1.1 link1
  • Install following plugins
    • Property File Reader – Config Element
    • Response Times vs Threads
    • Response Times Distribution
  • Set path to JMeter bin directory:
    • e.g.
      • export JMETER_HOME="/path/to/apache-jmeter-5.1.1"
      • export PATH=$PATH:$JMETER_HOME/bin

How to run tests from command line

REST API

  • cd $PROJECT_DIR
  • mvn clean test -pl restapi (or without 'mvn' if it's triggered from Jenkins)
  • Report screenshot: link1 , link2 alt text

SELENIUM

  • cd $PROJECT_DIR
  • mvn clean test -pl selenium -Duser.browser=chrome (or without 'mvn' if it's triggered from Jenkins)
  • Report screenshot: link1 , link2 alt text

Jenkins CI

LOAD (JMeter config)

  • e.g. jmeter -n -t $WORKSPACE/jmeter/toptal.jmx -l test.jtl -Jenvironment=${env} -Jmodule=${module}
  • Report screenshot: link1 alt text

About

Selenium - REST API - JMeter


Languages

Language:Java 100.0%