On one of my projects recently, I was tasked with finding an automation framework. Looking at my options..
- Cucumber (ruby, although other languages could be used)
- Capybara / Rspec (ruby)
- Robot Framework (python)
All of the options for web testing use either Selenium or Watir. I have only did a little with Watir, so I focused on something with Selenium for my first pass of experimentation.
I love testing if you know anything about me, I’m nuts about testing. Front End Testing however has been fruitless IMHO .. until a few years ago I discovered page objects and it became tolerable to do frontend testing. My projects changed and I didn’t really do much for a few years with web frontend testing.
Recently I have been looking into Python and discovered Robot Framework, meant to test a variety of things in addition to the web. The Selenium2 package is especially nice.
You can have a robot script as a text field, in a TSV, or other types of strutured text. I find the text file works for me.
Here we can define a Test Case:
1 2 3 4
This script opens the browser to youtube using firefox. Then checks that element located by id=yt-masthead-logo-fragment is visible (ie on the page, not display: none).
you must make sure to have two spaces between the elements
Or it won’t be able to parse. I guess this is when having it in a spreadsheet (TSV) would come in handy. But it’s not too bad to get the hang of. Plus if you use nice editors like PyCharm and the Robot Framework Plugin, it has nice syntax highlighting for you.
Running the test case like this:
And results look like this:
1 2 3 4 5 6 7 8 9 10 11 12 13
There that is just a taste of what it can do. If you want to see what all you need installed you can see my robot demo and some more complex tests. More testing posts to come on this, I think this is a very excellent framework … even if it is not ruby :)