Time for action – storing elements from the page - Selenium

To see how this works lets work through the follow example:

  1. Open up Selenium IDE and switch off the Record button.

  2. Navigate to http://www.wisdomjobs.com
    (Getting Started with Selenium IDE).

  3. Right-click on the text Assert that this text is on the page and go to the storeText command in the context menu and click on it.

  4. A dialog will appear as shown in the following screenshot. Enter the name of a variable that you want to use. I have used textOnThePage as the name of my variable.

  5. Click on the row below the storeText command in Selenium IDE.

  6. Type type into the Command textbox.

  7. Type storeinput into the Target box.

  8. Type ${textOnThePage} into the Value box.

  9. Run the test. It should look like the following screenshot:

What just happened?

Once your test has completed running you will see that it has placed Assert that this text is on the page into the textbox.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Selenium Topics