Automation - question on using Selenium with E2E testing


(Mark) #1

So we had a great question asked earlier on the Software testing clinic channel of Ministry of Testing slack that I wanted to share

I’m in a situation where dev’s use QUnit (for the most part) for testing and I’m leaning towards Selenium due to my strengths in Python (I’m QA). What are your thoughts on using Selenium for end-to-end testing? even better…a few engineers put together page objects with pretty cool methods a few years ago but they were never used - churt

Here was my response:

Firstly, I would encourage you to search out blogs and articles that talk about why we automate and how to use our testing analysis skills to determine what to automate. I would suggest you check out the whiteboard testing video on The jigsaw principle (https://www.youtube.com/watch?v=tAhCcPPzBlQ) and What to check and where (https://www.youtube.com/watch?v=InCyDS_uOGk)

Webdriver is a great tool but as an industry, we are somewhat biased to use Webdriver to mimic how we test in a more manual/sapient capacity. A good automation strategy to me use many smaller frameworks to focus on specific risks to give me feedback on what has changed, so you may have:

  • An API checking framework to check how the data is handled in the backend
  • Javascript unit checks to see how javascript works in a browser

I would also use Webdriver in an E2E capacity to ensure all my component parts integrate together, but I wouldn’t test a specific piece of functionality full stack E2E if I can stub it and hook into the closest interface possible. I use heuristics to help me determine what to test and where: http://www.mwtestconsultancy.co.uk/cross-browser-checking-anti-pattern/

This is, of course, my perspective. Can other mentors share their experiences? Are there related questions students have to this topic? Ask away below…


(Del) #2

The Jigsaw Principle = Lego Automation ?


(Mark) #3

Lego automation highlights the use of different libraries and frameworks but also covers much more. We ran a small version of it for Automation session last year that highlighted the complexities of automation and coding beyond just which tool to use and where.


(Del) #4

I chose to attend the STC workshop instead of Richard’s Lego Automation on the Tuesday before TestBash. I was sorely tempted by the latter, so you know, no pressure but STC better be good :wink:


(Mark) #5

I’m sure we can crowbar some lego in there somewhere


(Adam) #6

You can crowbar Lego into anything :wink:


(Francis) #7

“Jigsaw principle” is just a loosely coupled system.Each piece is just encapsulated and should have a common interface to make them swappable. If you investigate the SOLID principles, it can help you shape your code to give you this level of flexibility.


(Dirk) #9

Note: Yesterday I had a demo of Cypress. Cypress claims to solve all the problems of Selenium, and people I spoke to are very enthousiastic and use Cypress to run end-to-end tests. I made a seperate topic about Cypress, to try and collect experiences from other testers. See Who has experience with Cypress as a Selenium replacement?


(Viktoriano) #10

Have somebody tried Selenide as a replacement for pure Selenium WebDriver?


(Hugh) #11

Yes, been using it for a few months now. What is it your interested in knowing?