Why You Should Be Automating with RIDE/RobotFramework/Selenium

in programming •  5 years ago  (edited)

In my first Quality Assurance / Programming blog post, I want to share with you all a tool I use every single day in my professional life as a Quality Assurance Specialist.

That tool is RIDE - a lightweight editor for Robot Framework. In my particular case, I also use the Selenium Library, to give it a bit more flexibility and really get the most out of RobotFramework & RIDE. This setup allows me to test our company websites astonishingly easily and with a degree of confidence that is hard to match.

RIDE right now is compatible with up to Python 3.7.6, and that means that the entire installation is a simple series of pip installs!

pip install robotframework
pip install robotframework-seleniumlibrary
and pip install robotframework-ride

A key part of the ease-of-use is that RIDE provides a simple plain-English keyword dictionary that takes out a lot of the programming side. While I do know Java, and I'm getting a grip on Python, it's far easier to use RIDE - and it's also a lot easier to train other QA's in how to use, maintain, and expand a test suite even if they lack formal programming knowledge.

So, now that I've said that, I want to give you an idea what this tool looks like, and then go through some more specifics.

Basic test UI:

image.png

Here we see what constitutes the 'main' test screen for writing our tests. The left-hand tree is our Test Suite and individual tests within that Suite. The Right Top shows any special settings and an inner documentation window. If we had special setup, teardown, timeout, or templates we'd use them here. As you can see, we also can add any kind of Tags we want - which allows us to specify that we only want to run tests that have 'Quick Search' and 'Home' in them, as an example.

Below is the real meat-and-potatoes of the program. The left shows our RobotFramework or Selenium Library keywords in Light Blue.

Any User-Defined Keywords (in this case "Wait for processing" and "ContainsLoop"), are in Dark Blue. Many of the keywords require a locator or a value, and that's what you see in the next column(s).

Locating an object is fairly easy, and follows the same system any Selenium-based solution does. We can use an XPath or CSS to locate an element, and then in some cases take additional action or pass values.

As you can see from the keywords displayed, they all do exactly what you'd expect! And if you happen to forget what one does, you can just look it up in the keyword search.

image.png

As I mentioned earlier too, you can define your own keywords if you find yourself repeating processes a lot. I certainly did, so I have several that make my life easier. This one is a very straight forward example:

image.png

This confirms that whatever page I'm on contains whatever specific text I pass in. In the first screenshot, this is the address of a specific property, but on other pages could be a specific word I expect to see in a report output, or even just a dollar sign. It just depends on what I need to prove has shown up on that page!

One that is a bit more advanced (but still not crazy or all that impressive) is:

image.png

In this, it takes a different action depending on if I pass in a Market Identifier or not.You can see in the 'Arguments' line where I set some optional paramaters as well as default values for those in the event that nothing is passed in. ${num} for example will default to 1.

One more handy feature is that you can set up Scalar Variables, which can act as variables with a Key-Value pair.

image.png

This is extremely useful for things like User info:

image.png

Allowing you to pass the variable as &{User}[name] and &{User}[password], as we see here:

image.png

Another nice feature is that when you run a test, a file is generated for you providing you a log of the success/failure of your test.

image.png

And, I'm barely scratching the surface of what I think this tool is actually capable of. I'm relatively new to the world of automated testing, and have only really been using RIDE for a few months - but so far it's amazing! I very highly recommend RIDE for any automation testing you're doing!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!