In this post, I'm outling the process i used to setup an execution server used to run API tests using python.
Setup an API automation ready execution server
- Confirm Python -version (python --version)
- Install pip (yum -y install python-pip)
- Install pip environment (https://docs.pipenv.org/) (pip install pipenv)
- Upgrade it (pip install --upgrade pip)
- Install requests module (pip2.7 install requests)
- Install git (Yum install gut -y)
- Clone the git repo (git clone git://github.com/requests/requests.git)
- Cd requests; pip install.
I also found the below guides very useful to get a fundamental understanding of api testing.
- Beginner's Guide to API Automation with Python - https://www.grossum.com/blog/beginner-s-guide-to-automating-api-tests-using-python
- API Tutorials - https://www.dataquest.io/blog/python-api-tutorial/
GET Status codes
- 200 -- everything went okay, and the result has been returned (if any)
- 301 -- the server is redirecting you to a different endpoint. This can happen when a company switches domain names, or an endpoint name is changed.
- 401 -- the server thinks you're not authenticated. This happens when you don't send the right credentials to access an API (we'll talk about authentication in a later post).
- 400 -- the server thinks you made a bad request. This can happen when you don't send along the right data, among other things.
- 403 -- the resource you're trying to access is forbidden -- you don't have the right permissions to see it.
- 404 -- the resource you tried to access wasn't found on the server.
No comments:
Post a Comment