"storeText" and "storeTextPresent" command in selenium IDE

"storeText" command

"storeText" command in selenium IDE software testing tool is useful to store text value of page element of software web application in to variable for future use.

See bellow given example. In this example, When "storeText" command will be executed in selenium IDE software testing tool, value of page element "css=#gb_2 > span.gbts" will be stored into variable "k". If specified target element ("css=b" in this case) will be not found on software web application's page then it will show error message like "[error] Element css=b not found" in log area of selenium IDE window.

Note : Need Examples of all selenium IDE softwarecommand tutorials? Click Here to view them.

New Test
Command Target Value
open https://www.google.co.in/
storeText css=#gb_2 > span.gbts k
echo ${k}

"storeTextPresent" command

"storeTextPresent" command is not for storing value of any target element, but it is useful to verify that
specified target text is available on page or not. 

New Test
Command Target Value
open https://www.google.co.in/
storeTextPresent Images j
echo ${j}


In above example, it will verify if text "Images" is present on page or not. If it is present on page then it will store "True" in variable "j" otherwise it will store "False" in variable "j". You can use "Stored Variables Viewer" plugin to view value of variable.

No comments:

Post a Comment