Level3: Assignment1: Cannot find the UI element corresponding to this selector

Dear All,

Appreciate your quick help.

I am working on Assignment1 and having intermittent behavioral issues with System1_Login using IE.
It is observed working in a particular network, however does not in another.
It opens the IE and the ACME web, however it does not find the email field. I have tried ‘Find element’, ‘Element Exists’, ‘click’ on that particular element etc., however the error persists. Tried reading the values with debug messages, however ‘Element Exists’ is returning false. Screen attached.

Also, tried when I am getting “cannot communicate with Internet explorer”

  1. using the “regsvr32 oleacc.dll” command
  2. adding the webpage to trust list in Internet Setting

Regards,
Rahul

Versions:
UiPath Studio: 2018.2.3 Community Edition
IE version: 11.0.9600.19035CO
Microsoft Windows 7 Professional 64-bit
.NET 4.0.30319.36440

Error Message:
System1_Login has thrown an exception

Source: Type into Email

Message: Cannot find the UI element corresponding to this selector:

Exception Type: SelectorNotFoundException

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)
— End of inner exception stack trace —
at UiPath.Core.Activities.ScopeActivity.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
-----------------------------------------------------------------------------------------

Selector
Hello Sir! Try using this selector!
Also change waitforready to INTERACTIVE

Could you please try making the selector more reliable using UiExplorer, maybe try adding more tags!

Thanks Rishabh,

Using ‘Indicate on screen’ it generates below selector by default

However, I have treid modifying the selectors with multiple options by adding/removing more tags
Option1.

Option2.






Option3.




And many other options…

Somehow, kept getting the same error with More tags or less tags.

So this time I tried using Attach Window / Browser and kept all the activities in the ‘Do’.
It worked this way, though could not understand the behavior with selectors.

Anyway, It followed all the steps till extract system1 work items. I have below two things now.
Array_To_Strong

  1. As Information: I could see below warning as well in the Output pane: (screen shot attached).
    System error at initialization: Can not convert Array to String. at Source: Newtonsoft.Json


2. As Warning: (screen shot Attached)
Applications failed to close normally. Cannot find the UI element corresponding to this selector: at Source: Invoke System1_Close workflow: Attach Browser System1

Need your guidance, whether to continue with same topic or create a new one.

Thanks Niket…Appreciate it.

This was the default selector and tried with INTERACTIVE as well. No luck though…:frowning: .

For the attach browser , make sure your selector contains title=‘ACME System1 - *’

Hello @Rahul.Patil - Try this selector.

Regards,
Nitesh

Thanks @niteshn, This selector has worked well.

It has more tags (class,parentid & parentname) than what I used below

<webctrl id='email' name='email' tag='INPUT' type='text' />

Thank you !!!

1 Like

Thank you @Rishabh_Lakhera & @Niket_Ghai . I have moved forward and completed most part of the process and tested. Individual unit testings are working fine, however as an integrated process, it does not satisfy. It completes the operation with warnings, errors of maxretry. My last run given me success at alternate occurance of a WI5 item.

Need your help with below

A) System exception. Retry: 0. Cannot find the UI element corresponding to this selector: at Source: Invoke System1_ExtractClientInformation workflow: Attach Browser ‘iexplore.exe ACME’

This it tries for 2 times as per maxretry and then gives
System exception. Max number of retries reached. Cannot find the UI element corresponding to this selector: at Source: Invoke System1_ExtractClientInformation workflow: Attach Browser ‘iexplore.exe ACME’

B) I think this is the root cause.
When running the full Workflow from Main.xaml, the flow is not properly getting executed. It is opening both ACME & SHA1 site for every record as fresh and looses focus which might be leading to ‘Cannot find UI element for the selector’. When focus is required on ACME, it is on SHA1 and vice-versa.

Appreciate if you can guide on the mistakes I am doing.

Last test has performed with below pattern, except the first 2…it has worked alternatively.

  1. Completed
  2. Completed
  3. Open
  4. Completed
  5. Open
  6. Completed
  7. Open
  8. Completed
  9. Open
  10. Completed
  11. Open
  12. Completed
  13. Open
  14. Completed
  15. Open
  16. Completed

Could you please show how your attach browser’s selector looks like? :slight_smile:

Hi Niket,

Attach Browser selectors for below 2 places

  1. Workflow: System1_Login.xaml
    Selector at attach browser
    <html title='ACME System 1 - *' />

  2. Workflow: System1_ExtractClientInformation.xaml
    Attach browser selector

<html title='ACME System 1 - Work Items' />

Anyway I did some modifications today and getting below exception,

System exception. Retry: 0. Cannot find the UI element corresponding to this selector: at Source: Invoke System1_Update_HashCode workflow: Type into ‘New Comment’

Below selector is used for newComment

<html htmlwindowname='WI-Update' title='ACME System 1 - Work Items' />
<webctrl id='newComment' tag='TEXTAREA' />

Warnings_Output

Somewhere I am missing the flow, as it is opening both the System1 & SHA1 multiple times after closing(May be due to error).

Try using ‘ACME System 1 - *’ everywhere as the value for title attribute,
That causes an issue sometimes!

Thanks @Rishabh_Lakhera,

I have updated that generic selector all over…and it solved the selector issue. However 2 things are bothering.

  1. Alternate WI5 being updated for completion. I suspect the TransactionNumber = TransactionNumber+1 is not at the right place. As it is increasing 2 times.
    I have performed this increment just after the invoke Process.xaml is completed in Main’s Process Transaction Try block.


    I checked and it is the only place the increment is done.

  2. Still unable to find… why the SHA1 getting opened fresh for each of the new hash generation. or is it the intended. :frowning:

@Rahul.Patil
You dont have to increment the transaction nmbr!

It is automatically incremented
If you go to SetTransactionStatus.xaml file and check the Success sequence, you’ll find that the transaction number in incremented there :slight_smile:

Have you invoked the Open_SHAOnline file anywhere else except “InitAllApplications.xaml”?
It should only be there!

Hi Rishabh,

  1. I have removed the additional transaction number increment step and its moving perfectly txn by txn.

  2. SHA1Online_Open is invoked at two places. first at InitAllApplications.xaml and second inside SHA1Online_GetHashCode.xaml. Attaching screen shot.

Similarly System1_Login is also invoked at two places. screen shot for this also attached.

It is still failing at different selectors at each of run. Its not constant. below are few of them for reference…

System exception. Retry: 0. Cannot find the UI element corresponding to this selector: at Source: Invoke System1_ExtractClientInformation workflow: Get Text ‘Client Information Details’

System exception. Retry: 0. Cannot find the UI element corresponding to this selector: at Source: Invoke System1_NavigateTo_WorkItems workflow: Click Work Items

When I see the exception screen shots taken by the workflow, it is focused on SHA1 site… where it was supposed to be getting client info from System1 work item details.
I suspect the focus is not where it is required.

Appreciate If it is possible for you to review, I can share the work.

Regards,
Rahul

@Rahul.Patil

You shouldn’t be having SHAOnline1_Open in the GetHashCode Workflow!
It should only be present in InitAllApplications!