Robotic Process Automation (RPA)

 View Only

 Accessing the list values from a Window List View control.

Richard Aitchison's profile image
Richard Aitchison posted Wed August 20, 2025 09:40 AM

Hi 

I'm in the process to building a BOT that needs to iterate over a search result list in a windows app (to find a specific result to then select). The screen shot below shows the windows screen and the how the RPA recorder views that screen - search results are in the left hand panel:

I've been trying all sorts of controls to extract the list: gettable, getoptions etc using different selectors and they all end in errors:

With getoptions : (different selectors all result in the same error)
    getOptions --forcerefresh  --selector "XPath" --xpath "/root/pane[1]/pane[1]/pane[2]/pane[1]/list[1]" listProperties=properties
TestStack.White.Mappings.ControlDictionaryException: Multiple TestControls found for ControlType=list item and FrameworkId:WinForm - TestStack.White.UIItems.ListBoxItems.Win32ListItem, TestStack.White.UIItems.ListBoxItems.WPFListItem
   at TestStack.White.Mappings.ControlDictionary.GetTestControlType(String className, String name, ControlType controlType, String frameWorkId, Boolean isNativeControl)
   at TestStack.White.Mappings.ControlDictionary.GetTestControlType(AutomationElement automationElement)
   at TestStack.White.Factory.DictionaryMappedItemFactory.Create(AutomationElement automationElement, IActionListener actionListener)
   at TestStack.White.UIItemList`1..ctor(List`1 collection, IUIItemFactory factory, IActionListener actionListener)
   at TestStack.White.UIItems.ListBoxItems.ListControl.get_Items()
   at WDG.Automation.Runtime.Windows.White.WhiteListBox.<get_Options>d__7.MoveNext()
   at WDG.Automation.Runtime.GetOptionsCommandResponse..ctor(IEnumerable`1 options)
   at WDG.Automation.Windows.GetOptionsCommand.ExecuteCore(WindowsContext context)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at WDG.Automation.Language.CommandInterpreter.<Run>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at WDG.Automation.Language.ScriptInterpreter.<RunCore>d__17.MoveNext()

With gettable: (again different selectors end up with the same result).
    getTable --selector "IdAndName" --id searchResultsListView --name "Type Filter:" listTables=value listRows=rows listCols=columns

WDG.Automation.Windows.ControlIsNotOfTypeException`1[WDG.Automation.Runtime.Desktop.ITable]: Control is not of type 'ITable'
   at WDG.Automation.Windows.BaseWindowControlCommand.TryConvertTo[T](IControl control, Boolean throwOnError)
   at WDG.Automation.Windows.GetTableCommand.ExecuteCore(WindowsContext context)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at WDG.Automation.Language.CommandInterpreter.<Run>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at WDG.Automation.Language.ScriptInterpreter.<RunCore>d__17.MoveNext()

What am I doing wrong? Or how should I be processing this type of control?

Regards
Richard Aitchison

Tarcio Alonso Mota's profile image
Tarcio Alonso Mota

The second error is because you are trying to read an element that is not a Table, but a List, as a DataTable.

If you want to click on a specific item in the list, you can use the click command directly, passing the item you want to select:
/root/panel[1]/panel[1]/panel[2]/panel[1]/list[1]/item[@name="Element name"]

Since it is not possible to see the properties of each item, the last element of the XPath is generic.

Remember that in some cases the elements are assembled dynamically, so you need to perform another action before for RPA to load/identify the items on the list.
I don't know if this applies to you, but just for your information.

Richard Aitchison's profile image
Richard Aitchison

Realised that I created this question as the wrong type - as I don't seem to be able to respond directly to Tarcio's post.
Thanks for the response. 
The reason the question came about was that originally we'd been looking at using another RPA solution and it could extract the contents of that list control into a data table with a single call- so was expecting I'd be able to do the same somehow with IBM RPA.
I have though managed to work out a mechanism to process the list results in IBM RPA.
use GetControl to get the last entry in the list /root/pane[1]/pane[1]/pane[2]/pane[1]/list[1]/listitem[last()]
get it's index and then use a for loop (upto the index+1) to cycle through the individual list elements to find the one I'm looking for....