Create an automated test with selenium, python, and unittest

Given the test automation requirement is to automate the login process and create a note on the web application how would you approach this?

I would approach it by exploring the app first. I would get familiar with the user flow, what elements I could automate, what checks to implement. I would make notes on this.

Then I would write a pseudocode.


  1. Launch the web application
  2. Verify the elements exits
  3. Click login button
  4. Input username and password
  5. Click the login button
  6. Verify the elements exists on page
  7. Close the browser

After this I draft my code until the requirement is satisfied. I would test it several times then have someone review it.

After which I can commit it to the main repository as an approved test case.

Of course, the code could still be improved but that’s for another time.

Here is the code I made –

Comment and let me know your thoughts.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s