API automation using Python and open-source framework

Published by

Fleek Mark activities: , , Software Tester

Oct 18, 2021

python-project.html

Writing test case
As now you already have setup your python project with Pycharm, let’s create a new python file where we will add our test cases.

Please create a new python file in your project. Let’s name it “test_apitest.py”. Notice the “test_” in your file name. This is as per the rules for PyTest. We will be running our tests using Python’s inbuilt testing framework called PyTest. PyTest picks all those python files in your project which start with “test_” for test execution.

In “test_apitest.py” file, our first statement would be :

import requests
“requests” is python’s inbuilt module which is used to send http requests to a server. We will be using this module to send requests to our API and record the response.

Now, for this tutorial we will be using a sample test API available online : https://reqres.in/api
We will be sending requests to the endpoints defined in this API.

Read more on

Articles authored by Fleek Mark

Published: Dec 7, 2021

Published: Nov 10, 2021

Published: Nov 9, 2021

Published: Oct 14, 2021

Published: Oct 7, 2021

Published: Oct 1, 2021

Published: Sep 22, 2021

Published: Sep 1, 2021

Published: Aug 10, 2021

Published: Aug 3, 2021

Published: Jul 14, 2021