What is the actual use of Selenium IDE? Apart from playback and record How can we use this tool to check the validations of a simple login form in website?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
I used the Selenium IDE extensively on my last project. I had a suite of tests in a test domain specific language and a translator that created Selenium IDE test suites. When I left the project, there were more than 700 tests in the suite.
a) The test DSL was originally written in XML, based on a number of other test DSLs I had created for other projects. The test DSL was originally built to generate test scripts for humans to follow. When Selenium IDE came to my attention, it was quite simple to repurpose the translator to create Selenium IDE files. Several hundred test scripts were re-used.
The translator was an XSLT script, and bundled the individual test cases into test suites. Near the end, I rewrote the DSL and the translator into Perl, for much improved performance and readability. I looked seriously into rebuilding the process in Java but the incremental improvement in test coverage and browser coverage weren't justified.
b) The test DSL was actually generated from a bunch of spreadsheets, using a template language, translated by an XSLT script (then Perl).
c) Multiple data sets resulted in multiple files. A change to the UUT user interface required changing one master file for a form, and then regenerating the test suite.
Months after leaving the project, I still consider the Selenium IDE a godsend for UI test automation.
Yes, you can do validations using either verify or assert. Check this documentation which will give you a clear idea - http://docs.seleniumhq.org/docs/02_selenium_ide.jsp
For complex automation, you need to use Selenium WebDriver which gives you flexibility to code.
From the answer of @Bob Dalgleish you can see that output of Selenium IDE is quite hard to use. get XML, transform it with XSLT and Perl? No thanks!
IDE is useful to show locators, but test it generates are too linear and will repeat big chunks of code, as if they were copy-pasted. So if any change is made, chances are exactly the same change will need to be made in very many places. To avoid this, competent automated testers design test using PageObject pattern in their favorite programming language (which for me is Python).
As a result, I have very little use of Selenium IDE. If your fronted designer is competent, UI elements have ids, and "inspect element" will reveal it - that's all you need to know about it. Rest is code.
I prefer this approach possibly because I came to test automation with development background, so writing code was "normal" for me, and Se IDE was not helping much in accomplishing that goal. I don't want to maintain hundreds of lines of boilerplate generated code. If I did, I would be using Java :-)
A practical use of the seleniumIDE is testing your web site works correctly in firefox.
You use commands such as
to verify page contents
Generally you should avoid record and play (generates brittle tests that break easily as soon as the page is changed) and learn how to write good use of selectors yourself.
and put your page object descriptors in that file.
Example format of that file:
What we do is use the Selenium IDE to record scenarios, then save as Webdriver python scripts. The code in webdriver flavour is pretty readable and you can then modify the scripts as needed. You can use the IDE to add assert/verify or just add it in the scripts yourself. Then we use Robot Framework to drive these test cases, linked to Jenkins then you get yourself a low-cost automated testing. This won't cover 100% of your test plan but it has a very low technical requirement, so even the newest guy in QA can start to be productive within a day or less.