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");
}
}
Not able to find List items text value
-
- Posts: 35
- Joined: Wed Oct 31, 2018 2:10 pm
Not able to find List items text value
You do not have the required permissions to view the files attached to this post.
Re: Not able to find List items text value
Hi,
In my opinion, your code tries to read the "Text" attribute from wrong Text repo element (always first one) and not the Text element, associated with the actually looped ListItem? Please upload a Ranorex snapshot (NOT screenshot) of the problematic list. Screenshots are not useful here. Thanks.
In my opinion, your code tries to read the "Text" attribute from wrong Text repo element (always first one) and not the Text element, associated with the actually looped ListItem? Please upload a Ranorex snapshot (NOT screenshot) of the problematic list. Screenshots are not useful here. Thanks.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 35
- Joined: Wed Oct 31, 2018 2:10 pm
Re: Not able to find List items text value
Hi , Please refer attached snapshot.
Require solution asap.
Thanks
Ranorex xPath of problematic element(s) : /contextmenu[@processname='ProfileConsys']/list[@automationid='PART_Content']/?/?/text[@caption='Mid Range Low (70dB)']
Ranorex version : 8.1.1
OS version : Windows 7
Require solution asap.
Thanks
Ranorex xPath of problematic element(s) : /contextmenu[@processname='ProfileConsys']/list[@automationid='PART_Content']/?/?/text[@caption='Mid Range Low (70dB)']
Ranorex version : 8.1.1
OS version : Windows 7
You do not have the required permissions to view the files attached to this post.
Re: Not able to find List items text value
Hi,
I'm afraid, there is nothing to see in the snapshot you posted. It's almost completely empty, which means, it's useless Have you grabbed it with Instant Tracking? Eventually, capture the content of list directly with Create Snapshot recording action.
BTW, Ranorex 8.1.1 is too old and no longer supported. Please update Ranorex with most recent 8.3.1 and review the problem with it. Thanks.
I'm afraid, there is nothing to see in the snapshot you posted. It's almost completely empty, which means, it's useless Have you grabbed it with Instant Tracking? Eventually, capture the content of list directly with Create Snapshot recording action.
BTW, Ranorex 8.1.1 is too old and no longer supported. Please update Ranorex with most recent 8.3.1 and review the problem with it. Thanks.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration