Issue with selector

Hello, My customised selector is not working and got the below error message:
An ExceptionDetail,
likely created by IncludeExceptionDetailInFaults=true,
whose value is:
UiPath.Core.SelectorNotFoundException: Cannot find the UI element corresponding to this selector: ----> System.Runtime.InteropServices.COMException: Cannot find the UI element corresponding to this selector:
at UiPath.UiNodeClass.FindFirst(UiFindScope scope,
String nodeID)
at UiPath.Core.UiElement.FindFirst(FindScope scope,
Selector selector,
IVariableResolver resolver)
— End of inner ExceptionDetail stack trace —
at UiPath.Core.Activities.TaskAsyncCodeActivity`1.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context,
IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)

Please suggest how to handle this issue, please find the screenshot as below:

1 Like

@cschevuri

Hi,

Can you share how it looks in the UiExploler, you are getting an error because this selector does not exists, so probably you should use somewhere wildchars

Please find the UiExplorer as below:

and i have customised the selector as below:
ctrl name=’ # Row “+Counter5.ToString()+”’ role=‘cell’

@cschevuri

OK i se the difference between those 2 selectors, In first one you don’t have a “space” before # char.
Try to Add star char “*” before “# Row” word. Probably this is the case.

image
image

"<wnd app='winquote.exe' ctrlname='DB5Form' /><wnd ctrlname='panel20' /><wnd ctrlname='tabControl1' /><wnd ctrlname='tabPage1' /><wnd ctrlname='panel27' /><wndctrlname='tabControl2' /><wnd ctrlname='tabFrameDeptOpt' /><wnd ctrlname='frmoptionlist' /><ctrl name='DataGridView' role='table' /><ctrl name='Row 1' role='row' /><ctrl name=*'# Row "+Counter4.ToString()+"' role='row' />"
Changed as above , still not working, i tried “*” before #,
Please correct me if anything is wrong.

It should be like this:

"<wnd app='winquote.exe' ctrlname='DB5Form' /><wnd ctrlname='panel20' /><wnd ctrlname='tabControl1' /><wnd ctrlname='tabPage1' /><wnd ctrlname='panel27' /><wndctrlname='tabControl2' /><wnd ctrlname='tabFrameDeptOpt' /><wnd ctrlname='frmoptionlist' /><ctrl name='DataGridView' role='table' /><ctrl name='*Row "+Counter4.ToString()+"*' role='row' /><ctrl name='*# Row "+Counter4.ToString()+"*' role='row' />"

I did not understand, can you please elaborate more.

You have to insert wildchars for both fields where ROW + number is used. Please see exampe i have added.

I tried with new selector code given by you, i have added a check point for click event and debugged, still not able to click the check box , please refer the below screen shot:


please see the output messages.

Iam reading data from excel sheet and comparing with Data Grid (Data scrapping), so if the element matches, it should click the checkbox in my windows based application,for earlier two jobs it worked well, flow of the sequence as below:

  1. Data scraping of datagrid & store as data table
  2. Assign a counter=0
  3. For each row Grid in Data table(application grid)
  4. For each rowExcel in Excel data table
  5. If rowGrid(2).ToString() = rowExcel(1).ToString()
  6. Assign selector (Customised selector)
  7. Click cell row Customised Selector in Target (Configured in properties)

OK, can you put selector i made to the write line just before click activity, and create breakpoint on it, then using step into, check what kind of selector it displays, then use UiExploler and check once again selector of element, compare those 2 values. Probably there will be one more difference which i couldn’t see while comparing screenshots.

Write line is printing as below:
"<wnd app='winquote.exe' ctrlname='DB5Form' /><wnd ctrlname='panel20' /><wnd ctrlname='tabControl1' /><wnd ctrlname='tabPage1' /><wnd ctrlname='panel27' /><wndctrlname='tabControl2' /><wnd ctrlname='tabFrameDeptOpt' /><wnd ctrlname='frmoptionlist' /><ctrl name='DataGridView' role='table' /><ctrl name='*Row 3*' role='row' /><ctrl name='*# Row 3*' role='row' />"

When the above selector is verified in UiExplorer, getting a message as below:
The selector is not valid.
Screenshots for reference as below:

image

Try to use retry scope activity and in condition use the element exists on this customized selector and if it is true then in action click the check box.

Thank you @rado @ISRIRAM,
Finally it worked after removing one space in the selector as below:
"<wnd app='winquote.exe' ctrlname='DB5Form' /><wnd ctrlname='panel20' /><wnd ctrlname='tabControl1' /><wnd ctrlname='tabPage1' /><wnd ctrlname='panel27' /><wnd ctrlname='tabControl2' /><wnd ctrlname='tabIndptOpt' /><wnd ctrlname='panel17' /><wnd ctrlname='indoptionlist' /><ctrl name='DataGridView' role='table' /><ctrl name='Row "+ Counter5.ToString() +"' role='row' /><ctrl name=' # Row "+ Counter5.ToString() +"' role='cell' />"

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.