Friday, June 7, 2013

How to select a value from Drop down?

To select a value from Dropdown we need to use the below command.Select an option from a drop-down using an option locator.
Option locators provide different ways of specifying options of an HTML Select element (e.g. for selecting a specific option,  or for
asserting that the selected option satisfies a specification). There are several forms of Select Option Locator.
  label=labelPattern: matches options based on their labels, i.e. the visible text. (This is the default.)
o  label=regexp:^[Oo]ther
Usage:
selenium.select(selectLocator, optionLocator);
selenium.select(“id=abc”,”label=shopping”);

No comments:

Post a Comment