For BDD and any use-case tests, it is important to be able to report what the test does. The problem with many test suites is that no one can say for sure what the test does. This very often occurs if you write in a non-specialized language. Specialization does not necessarily mean a particular language, but abstractions in one language are enough, so itโs clear what is happening.
For example, many tests have code that looks like this (pseudo-code, I will not choose any particular structure):
object = createBrowser() response = object.gotoURL( "http://someurl.com" ); element = response.getLink( "Click Here" ); response = element.doClick();
Itโs hard for someone to quickly translate to a business driver (perhaps a product manager or user). Instead, you want to create specialized functions or a language if you are adventurous, so you can have this:
GotoURL http://someurl.com/ Click link:Click Here
Selenium and its macros or interface are still pretty low in this regard. If you use them, at least create some wrappers around them.
You can also use a product called TestPlan . It has Selenium in the background and provides a high-level API and customizable langauge for testing. It also goes beyond the Internet only, including email, FTP, etc. The language of the example above is a TestPlan fragment
source share