Translate

Monday, June 26, 2017

Ruby + Selenium Webdriver basics

Here are a couple basic things to know when writing an automated test in ruby using selenium webdriver.

First is Mapping a page.
I know this may seem redundant but it actually makes for reading a whole lot easier.

Second is adding the right elements.



The first snippet are the list of elements created. The second is actual code to make a slider element. Like mapping this may seem trivial but improves readability which in turn saves time and money

Third is clear concise test
This is important because for every extra step you have in there it slows down performance which costs extra money. When it fails it also makes it difficult to debug.



Fourth write useful functions
If you know you are going to be using a same step(s) over and over. Write a function or class that will do it. This will add to clarity and readability.