It’s easy to get to know if particular option is available in drop-down field, as we just select that option and it verifies that…OK option is available. However if we want to verify that particular option is not available in some drop-down field then we need to think about some trick. One of trick is given below to get to know that option is not available-

public Boolean CheckOption(browser, String DropDownObjectID, String Option)
{
HtmlComboBox SelectObject = new HtmlComboBox(browser);
SelectObject.SearchProperties.Add(“Id”, DropDownObjectID);
SelectObject.DrawHighlight();
String[] Selectoption = SelectObject.GetContent();
Boolean result = false;
foreach (String data in Selectoption)
{

if (data.Contains(Option))
{
result=true;
}
}

return result;

}

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s