Friday, August 21, 2009

Example for gotoLabel command in Selenium IDE

Here is the example for gotoLabel command. When Selenium IDE encounters gotoLabel command, it searches for targetted label name in the rest of the script and passes the control to targetted Label and the executes the steps from Label command and skips the steps that are in between gotoLabel and Label commands. When the targetted label is not found it throws error.

Extension for Label Command:
Selenium.prototype.doLabel = function(){};

Example:


http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
http://selenium-ide.openqa.org/profiles/test-case">

http://www.google.co.in/" />
New Test

























































New Test
open http://www.google.co.in/
verifyText link=Go to Google.com Go to Google.com
gotolabel label1
clickAndWait link=Go to Google.com
verifyTextPresent this wont execute
clickAndWait link=Go to Google India
label label1
verifyTitle Google




No comments:

Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory