This certification is meant to introduce you to Python and Selenium for testing (UI & API) and automation.
To get started and follow along, make sure to setup your machine and project to use Python. You can do this by following the instructions for our standardized setup in this google doc:
- Each challenge will introduce different concepts.
- Complete each challenge and push your code to GitHub so the instructor(s) can validate.
- Completing all challenges will get you this certification!
- The student is familiar enough with Python, Selenium and Pytest that they can begin automating tests and solving problems.
The best place to ask questions is the #autobots channel in our QA Utah Slack group which you can join by going to https://qap.dev/autobots. Otherwise, feel free to reach out to the instructors:
- Matt Chiang
- Carlos Kidman
This README will contain the high-level overview and requirements for each challenge. However, make sure to checkout the Wiki which will contain more specific details and information about each challenge, if applicable.
Also, you will have access to the code base which will provide structure and examples so you can have a reference.
Complete the Start Here
section of the Wiki to get everything setup: Wiki Home Page
Now you are ready to take on the challenges!
Within test_challenge1.py
, write a new test that does the following:
- Go to google.com
- Search for “puppies”
- Assert that the results page that loads has “puppies” in its title
Create test_challenge2.py
and write a test that does the following:
- Go to copart.com
- Search for "exotics"
- Assert "PORSCHE" is in the list of cars on the Results Page
Create test_challenge3.py
and write a test that does the following:
- Go to copart.com
- On the Home Page, under
Most Popular Items
, there is aMakes/Models
section. For each Make or Model in this section, print the name of the Make or Model with its URL (akahref
) next to it
Example Output:
SILVERADO - https://www.copart.com/popular/model/silverado
Fibonacci (recursion)
Create test_challenge4.py
and write a test that does the following:
- Displays the fibonnaci sequence for N numbers
- However, print the number(s) as English words
Example: If the sequence is
18
, then print"Eighteen"
Example: If the seqence is
120
, then print"One Hundred Twenty"
Part 1 - Create test_challenge5.py
and write a test that does the following:
- Go to copart.com
- Search for "porsche"
- Change
Show Entries
to 100 - Print the number of occurrences for each Model
Example: There might be x3
PANAMERA T
and x11CAYENNE
Part 2 - Using the same, first three steps of Part 1, write a test that then does the following:
- Count the number of occurrences of each Damage type
- However, you need to map the Damage types to these:
- REAR END
- FRONT END
- MINOR DENT/SCRATCHES
- UNDERCARRIAGE
- Any Damage type that does NOT match the above types should be grouped into a
MISC
Damage type
Example:
SIDE
andALL OVER
would each count towardsMISC
Example Output:
REAR END: 2, FRONT END: 7, MINOR DENT/SCRATCHES: 22, UNDERCARRIAGE: 0, MISC: 4
Create test_challenge6.py
and write a test that does the following:
- Go to copart.com
- Search for 'nissan'
- Then for the Model, search 'skyline'. This is a rare car that might not exist
- If it doesn't exist, catch the exception and take a screenshot
Create test_challenge7.py
and write a test that does the following:
- Go to copart.com
- Look at the
Makes/Models
section of the page - Create a
two-dimensional
list that stores the names of the Make/Model as well as their URLs - Check that each element in this list navigates to the correct page
- Push all of your completed code to your repo
- Notify
Matt Chiang
orCarlos Kidman
- Code Review will be done
- Complete any requests that are given from review
- Once the challenges are signed off, you will receive the certification!
Now that you have done some work in Python and Selenium, we are going to go level deeper and work with RESTful APIs and data. We will use a library called requests
to make working with these APIs easier.
- Open the Terminal in PyCharm
- Install
requests
$ pip install requests
- All set! You can now
import requests
The API Endpoint https://www.copart.com/public/lots/search
Create test_challenge8.py
and write a test that does the following:
- Using the above endpoint, search for
Toyota Camry
and print the results - Do this for 9 other cars that you like. ('Nissan Maxima', etc.)
This is an extension of Challenge 8.
Create test_challenge9.py
and write a test that does the following:
- Uses the same response as Challenge 8, but write assertions about elements in the JSON response
- Part of your test(s) needs to assert that those elements are of the correct Type.
Example, "lotNumberStr" should be a String
This is also an extension of Challenge 8.
Create test_challenge10.py
and write a test that does the following:
- You will be reading data from an Excel Spreadsheet or CSV file.
- Depending on the columns and rows of data, you will generate test cases from this
For example, you may have a data table that looks like this:
| MAKE | MODEL | YEAR
___|_____________________________________________
1 | toyota | |
2 | | camry |
3 | | | 1997
4 | toyota | avalon | 2018
In that case, you would have a single test function that had 4 separate test cases.
You would only need to switch out the make
, model
and year
variables with the data from this table.
HINT: Pytest's
@pytest.mark.parameratize
decorator will be helpful once you have read the data from the file.
Create test_challenge11.py
.
- Write a webcrawler that will navigate to every page on copart.com
Don't worry about crawling all of the data for now because we don't want to seem like we're doing a DOS Attack
This is the final challenge for the Level 2 Certification.
This challenge will act as sort of a "Master Thesis" meaning that you need to do your own research and build your own solution.
- Create a mechanism to automatically trigger your tests
- Hook your tests to a reporting framework
Part 1 of this challenge is to automatically trigger your tests. There are so many ways to do this, but to give you some help as to the tools that are out there, here's a list of possible options (remember, there are more):
- Jenkins
- TeamCity
- Bamboo
- Code Fresh
Part 2 of this challenge is to make your tests self-reporting. Again, there are many ways to do this. Maybe you save a spreadsheet with your results or send yourself an email.
Challenge 12 is an opportunity to show what you learned throughout these challenges and really be creative and express your thoughts and ideas as code. Have fun with it, and as always, let us know if you have any questions.
GOOD LUCK!
- Push all of your completed code to your repo
- Notify
Matt Chiang
orCarlos Kidman
- Code Review will be done
- Complete any requests that are given from review
- Once the challenges are signed off, you will receive the certification!