How to pass Multiple Values to Attributes of Element Exists Activity

While using Element Exist Activity for Indicating Pop-up, sometimes it is showing Value of “Role” attribute ‘dialog’ and sometimes ‘alert’

Please suggest me a solution to use both values at once for Role Attribute of Element Exists Activity.

image

image

Hi @Bhavesh_Batra

Give like this

<webctrl role='dialog' or role='alert' />

I hope it helps!!

@Bhavesh_Batra
Try These two:

<webctrl role='dialog' | role='alert' />

<wnd app='*' role='dialog' />
<wnd app='*' role='alert' />

Not Working Sir

Showing error

Showing error, it is not working.

@Bhavesh_Batra did you try second one also.

@Bhavesh_Batra
I suggest you another possible solutions:

  1. First one is wild card
role='*'
  1. Second one:
    use 2 Element Exist for both roles separately and by using if condition put 2 separate clicks

@Bhavesh_Batra

  1. Add two “Element Exists” activities to your workflow, one for each attribute value.
  2. Configure the first “Element Exists” activity to target the pop-up dialog with role='dialog'.
  3. Configure the second “Element Exists” activity to target the pop-up dialog with role='alert'.
  4. Use the output of the first “Element Exists” activity as a condition in an “If” activity. This condition checks if the pop-up dialog with role='dialog' exists.
  5. If the condition is true, handle the pop-up dialog with the necessary actions.
  6. If the condition is false, use another “If” activity with the output of the second “Element Exists” activity. This condition checks if the pop-up dialog with role='alert' exists.
  7. If the condition is true, handle the pop-up dialog with the necessary actions.
  8. If both conditions are false, proceed with the remaining steps of your automation.

Thanks a lot @raja.arslankhan

Can you Please suggest a solution which involves only 1 Element Exists…??

@Bhavesh_Batra
Another method:

Did you try regex selector.
I suggest you please check Regex selector examples:
Try this one

role='(dialog|alert)'

@Bhavesh_Batra
Documentation:
https://docs.uipath.com/studio/standalone/2023.4/user-guide/regex-search

With one element exist approach is not reliable in case of two different selectors. I prefer solve it through regex selector and use one element exist.

1 Like

Sir, Thanks a lot, It is working Fine Now

This is the Final Solution …

1 Like

@Bhavesh_Batra welcome…Happy automation

1 Like

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