Skip to content

Here is the project to test API using JMeter and fake API is powered by JSON-Server

Notifications You must be signed in to change notification settings

hienhoangminh/jmeterrestapi

Repository files navigation

Build a fake API with JSON Server and API Testing with Jmeter

Here are the details to run the project:

1 . Setup the server:

  • Requirements:
  • Check if NodeJS exists with command line : node -v. If not, please install it
  • Install JSon-Server with command line : install -g json-server
  • Check if JSon-Server is installed by command line : json-server
  • Install JDK and JMeter
  1. Explanation :
  • JSon-Server works with only object-oriented syntax. That means you should have a JSON file like : { “objects” : [ {object1}, {object2} ] } To check if your JSON file is ok, go to this link : localhost:3000/objects. If everything is ok, you should see your API available.
  1. Run the test:
  • Start the API by launching the following command line : json-server --watch "path/to/file.json"
  • Open JMeter and browse to the file with extension = .jmx
  • Click run to see the result

You also could browse to this link : http://www.testing.vn/jmeter-tai-lieu-huong-dan-build-api-bang-json-server-va-test-api-su-dung-jmeter/

Happy testing !

About

Here is the project to test API using JMeter and fake API is powered by JSON-Server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published