Testing  has eventually become an important phase in a software development life cycle.     Hence the cost of testing has also become an important factor for any project. Thus, organizations have started implementing open source automated testing tools instead of premium commercial testing tools. The greatest advantage of open source tools is that it does not require any licensing costs.

Open source testing tools can be implemented for all test types such as functional, performance, compatibility, user acceptance, etc.  For other testing types such as white box, black box, unit testing, there are one or the other type of testing tools.

Selenium is one of the best options for an open source automated testing tool. It can also be used as a Unit Testing tool for JavaScript.

Selenium has three modes of executing test cases:

Selenium IDE – Record and Playback – It records the test cases in Firefox. Individual tests can be written and save either individually or as a group. These test cases can be exported into other programming languages and run on different testing frameworks. The recorded tests can also be played back at a later time to check for the validations.

Selenium RC – Remote Control Mode – Here, Selenium starts with multiple browsers. Tests can be run in a preferred language. This enhances the test cases and covers the required test scenarios.

Test Runner Mode – In this mode, the test cases are recorded and played back in the form of HTML tables.

The most commonly used commands in Selenium IDE:

open: Opens a page through a URL.

clickAndWait: A click operation is performed and  waits for a new page to load.

verifyTitle: Verifies title and continues to run if it fails.

assertTitle: Verifies an expected page title and execution stops if it fails.

verifyElementPresent: Verifies an UI element, defined by its HTML tag.

verifyTextPresent: Locates that the expected text  somewhere on the page.

verifyText: Verifies that the text and its corresponding HTML tag are present on the page.

waitForPageToLoad: Pauses execution until an expected new page loads.

waitForElementPresent: Mainly used with AJAX calls, it pauses execution until an expected UI element, as defined by its HTML tag, is present on the page.

Writing a Test Suite:

It is mainly a collection of test cases. Pre existing test cases can be loaded by going to File -> Add Test Case menu option. Pre existing test cases can be added to a new suite.  A test suit is basically an HTML file of a one column table.  Each cell in the table contains a link to a test case.

Execution of Selenium IDE Tests

Tests that have been developed using Selenium IDE can be run on other browsers as well. This can be done using the command line interface which invokes the  Selenium RC server.       

Conclusion

Selenium is comprised of 4 components – Selenium IDE, Selenium RC, Webdriver and Grids. Because of their differences in architecture, they support different browsers.Hence, it is important to understand the concept of each to choose the right Selenium tool for your project.

Source : articlesbase.com

0 comments:

Post a Comment

 
Rewrite Article © 2016.Someright Reserved.
Top