Delivered by FeedBurner

Storing and Reusing Information in Selenium IDE

"How to Store and Reuse Information in Selenium IDE ?" This question is asked by one of my blog reader through Ask A Question page so let me share it with all of you. It might helps you too for software testing using selenium IDE. Question is as bellow.

Question : 
Using Selenium IDE, how do you:

1. Capture a dynamic number (a new number everytime you use the site)
2. Enter that same number into a search box
3. Find the number later.

Here is what I am trying to do.

1. Create a new workorder
2. Capture/store the workorder number somewhere
3. Log in as a different user
4. Search for the workorder number created in step 1

Answer : 

Here i am assuming that you are already aware about how to record your script for creating your work order(Step 1) and login(Step 3) steps.

1. Answer of "Capture/store the workorder number somewhere"
Use Command storeText || Element Locator || WorkorderNo to store your work order number in variable = WorkorderNo

(Use your element's id or name or xpath or CSS path of element (where your workorder text is located) at place of word Element Locator in above example command. You can read my posts about element locators if you are not aware about element locators. )

2. Answer of "Search for the workorder number created in step 1"
Use Command type || Element Locator || ${WorkorderNo} to type workorder number in destination field search box.

(Here you need to use your search field's id or name or xpath or CSS path at place of Element Locator text).

This way storeText Command will store your software web application work order number in variable = WorkorderNo and you can reuse it's value using type Command.

1 comment:

  1. Hi Aravind,

    Several add-ons allow test data to persist between Selenium IDE sessions. They also help Selenium IDE tests to be packaged, reusable and maintainable.

    See SeLite – It enables
    – functions shared across test cases, loops, and other code structures
    – enhanced expressive syntax
    – test database (isolated from the application database)
    – automatic detection of webserver errors/warnings
    – custom fine-grain configuration schemas.