Tips and Tricks with Python Selenium Workshop

Tips and Tricks with Python Selenium Workshop, conducted by Arvind Padmanabhan from devopedia. This was my first workshop after moving to Bangalore. It was about how to automate testing, what were the things to look for while testing using python selenium.

This blog does not cover all the things Arvind pointed. I had written down various questions that occurred to me at various points of the workshop. 90% of were covered before we reached the QA session. This blog is a compilation of all those questions with answers.

My experience with selenium

I used selenium to automate the user interaction when I was working on the interviewbot project. I used Selenium IDE with Firefox record import and modify the script as per the requirement. It gave me a basic idea of what and how to use selenium. I missed the intuition of where and how is it used in the industry. That was the main reason for attending the workshop.

The Selenium workshop

Is selenium testing a part of unit testing?

No. It is not. Selenium testing is more like a regression testing where testers do not have access to the code. Unit testing tests the logic of the code where as selenium tests the expected functionality is met. That answers my next question, You can integrate selenium as a part of existing unit test with some extra code but not a common practice in the industry.

How does selenium work?

This architecture diagram will give you an idea of how selenium works.

How to come up with a test suite from a blank page?

devepedia test architechture

An architecture diagram like this would help before you start coding.

Would you prefer TDD to be done with selenium?

Not required. Regression testing is done to make sure that the new changes haven’t broken anything, before pushing the code to production. Selenium tester won’t have access to the code hence TDD does not make sense.

Note : it depends on how teams work together in the project. It’s quite possible that tests and developers agree in advance the classes and IDs that are going to be used for DOM elements. This is enough as a starting point for testers to write tests even before the code is ready.

How to test on multiple versions of the browser?

We need to install a different version of browsers into the system and setup a selenium environment.

You can read this stackoverflow thread for more details.

How to test UI responsiveness?

While configuring your test suite you can provide different dimensions in which you want to test.

Can we test code coverage in selenium?

No. Since we don’t have code access. In selenium testing there is a possibility that some parts of the code may never be reached.

How to wait on ajax response?

Selenium provides an API called explicit wait. An Ajax would not make sense if it is not going to change a UI  element. Hence an explicit wait has to be configured on change of that UI element.

What are the other things that I should keep in mind?
  1. Differences between chrome and firefox web driver?
  2. Few tips and tricks

Here is the link to the complete presentation

Would be happy to hear your comments and your experience with selenium testing