Not able to find List items text value
Posted: Fri Nov 02, 2018 3:57 pm
Hi ,
I am using Desktop application and I need to retrieve text from ListItems present in List .
I have written below code and i could not find text values. When I try to debug it is showing "null" for S and for dropDownListText showing Timeout. Though in count it is having 4.
Please refer attached screenshot.
Please suggest solution for the same. I am stuck from so many days
repo.applicationName.PARTItemsPresenter.cell_DeviceSensitivity.Click();
repo.applicationName.PARTItemsPresenter.PARTItem.Click();
repo.applicationName.PARTItemsPresenter.PARTItem.Click();
IList<Ranorex.ListItem> dropDownListText = repo.ContextMenu.PARTContent.Items;
foreach (Ranorex.ListItem element in dropDownListText)
{
ListItem s = repo.ContextMenu.PARTContent.Items.ElementAt(0);
Report.Log(ReportLevel.Success,s.Text);
}
if (repo.ContextMenu.PARTContent.Items.Count > 0)
{
Report.Log(ReportLevel.Success,"Success ");
}
else
{
Report.Log(ReportLevel.Failure,"Failed");
}
}
I am using Desktop application and I need to retrieve text from ListItems present in List .
I have written below code and i could not find text values. When I try to debug it is showing "null" for S and for dropDownListText showing Timeout. Though in count it is having 4.
Please refer attached screenshot.
Please suggest solution for the same. I am stuck from so many days
repo.applicationName.PARTItemsPresenter.cell_DeviceSensitivity.Click();
repo.applicationName.PARTItemsPresenter.PARTItem.Click();
repo.applicationName.PARTItemsPresenter.PARTItem.Click();
IList<Ranorex.ListItem> dropDownListText = repo.ContextMenu.PARTContent.Items;
foreach (Ranorex.ListItem element in dropDownListText)
{
ListItem s = repo.ContextMenu.PARTContent.Items.ElementAt(0);
Report.Log(ReportLevel.Success,s.Text);
}
if (repo.ContextMenu.PARTContent.Items.Count > 0)
{
Report.Log(ReportLevel.Success,"Success ");
}
else
{
Report.Log(ReportLevel.Failure,"Failed");
}
}