List item not selected
Posted: Mon Nov 12, 2012 8:07 pm
can't find the item from the drop downlist since to get to the last item needs to be scroll down , tried w/focus, also tried- ListItem item = "/container[@caption='selectbox']/listitem[@text='"+_rateID+"']";
Delay.Ms(3000);
item.Click();
Delay.Ms(3000);
item.Click();
Code: Select all
public void SelectAddRateID(string _rateDDL, string _rateID)
{
bool found = false;
bool foundItem = false;
WebDocument webDocument = "/dom[@page='index.cfm']";
SelectTag findRate;
found = webDocument.TryFindSingle(".//select[@id~'pta_.*_cboPayTypeAdditionalID_"+_rateDDL+"']", 30000, out findRate);
if (!found)
{
throw new Ranorex.ElementNotFoundException("SelectAddRateID List was not found", null);
}
else
{
findRate.Click(Location.CenterRight);
Delay.Ms(1000);
OptionTag optItem;
foundItem = findRate.TryFindSingle(".//option[@innerText='"+_rateID+"']",5000, out optItem);
if(!foundItem)
{
Mouse.ButtonDown(System.Windows.Forms.MouseButtons.Left); //problem w/scrolling down
Delay.Milliseconds(4000);
//findRate.("{Next}");
optItem.Click();
Delay.Ms(3000);
}
else
{
optItem.Click();
Delay.Ms(3000);
}