This a small sample code for API testing using Python.
Steps to run and execute the test:
-
Make sure you have the pip / pip3 installed and python version 3.+ installed
-
Clone or download this repository:
git clone: https://github.com/grandEL-dsouza/API-testing-sample.git
- Install the requests library using one of these commands:
pip install requests
if you have pip3 installed then use:
pip3 install requests
If you face any issues in installation use this command for installing requests:
python3 -m pip install --user requests
- Run the test by clicking the run button through the IDE or use the following command:
python3 solution.py
Once done the test will execute and output will be printed on the console / terminal.