Scroll to CurrentElement in For Each Ui Element Activity

Hello,
If I am using For each ui activity to highlight all similar Ui elements on a webpage, Highlight is performed but only to elements that are in viewport. Elements that are below on the page are highlighted but i want them to bring to viewport as automation is being done on them. For using loops I need condition, that I am not able to figure out. e.g, check app state, check element, set focus etc , I tried all these activities to get Boolean value (if element is visible or not), but I am not able to do that as all such activites check elements that are not on viewport and so Boolean variable returns true value. I also tried Mouse Scroll to scroll to element, but I cannot configure Target element to current element ( I tried all available options there).
Kindly suggest best possible ways to counter this issue.
thanks in advance!

@Mubeen_Hassan,

Assigning current UI element to target property of mouse scroll activity is the best option.

Could you specify issue you are facing while doing this?

Thanks,
Ashok :slightly_smiling_face:


In target option Which selector I have to use. I tried writting ‘CurrentElement’ in them, but get an error that Ui element is not supported.
Please help me with that problem.
thanks!

@Mubeen_Hassan,

Ok lets try this approach.

  1. Use For Each Ui Element
  2. Use Get Attribute to get reliable dynamic attribute of the Ui Element to identify the Ui Element in next step.
  3. Use Mouse Scroll activity. Highlight first or any Ui Element from your desired Ui Elements.
  4. Uncheck all other selectors type and keep only Strict selector and make it dynamic with the values extracted step before.
  5. You can extract multiple attribute if your selector requires.

Sample Workflow:


U

Code:
MouseScrollDemo.zip (427.3 KB)

Execution Demo I have tested:
The image shows a UiPath Studio workflow with activities designed for web automation, including a browser interaction with YouTube and UI element processing with a mouse scroll. (Captioned by AI)

Thanks,
Ashok :slight_smile:

1 Like

@Mubeen_Hassan

You can directly use Hover activity…and pass currentelement in input element field

Cheers

1 Like

Thanks a lot for putting so much time and solving my Problem. I really appreciate that!
I had to get parent ID in get attribute activity and my problem was solved.
Once again Thanks @ashokkarale
Regards,
Mubeen Hassan

1 Like

@Anil_G I tried your suggestion too and it is as useful as the solution given by @ashokkarale . I would never have tried Hover activity for that xD. Thanks for your suggestion!
Regards,
Mubeen Hassan

1 Like

@Mubeen_Hassan,

Glad to hear I was helpful :blush:

Happy automation :star_struck:

1 Like

@Mubeen_Hassan

Happy Automation :slight_smile:

cheers

1 Like

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