Automated Selection of Authors with Contact Icons on a Webpage

webpage with a list of authors and associated contact icons, such as mail icons, next to their names. Your goal is to programmatically identify and click on the names of authors who have a mail icon beside their names. However, some authors may not have any icons, while others may have different icons that are not relevant (e.g., icons for social media or website links).

Hi @LOHITH_KUMAR_SAKA

We can accomplish this using the For Each UI Element activity. Follow the steps below. They might seem a bit confusing, but follow them carefully
→ Drag and drop the For each Ui element activity and indicate on any one of the author then it will automatically extracts all author information, check the below image,

→ Then click on confirm in the CurrentElement option in the For each Ui element window.
→ Then click on Add label option in the same window.
→ Then indicate on the mail icon for which author it has, then it automatically extracts all the mail icons for authors who have. Check the below image,


→ Click on Confirm in the CurrentLabel_1 option.
→ Then click on save&Close option in the same window.
→ The output of For each Ui element activity is CurrentElement and CurrentLabel_1
→ Come back to the Studio inside for each Ui element activity insert the if condition and give the below condition,

- Condition -> (Not(String.IsNullOrEmpty(CurrentLabel_1) Orelse String.IsNullOrWhiteSpace(CurrentLabel_2)))

→ Inside then block insert the Click activity and open the properties, find the Input element option and pass the CurrentElement to it.

That’s it. I already checked, and it is working as expected. It clicks on the authors who have a mailbox.

Hope it helps!!

Be careful while indicating the element by using for each Ui element activity… @LOHITH_KUMAR_SAKA

Check the below worflow for better understanding,

Hope you understand!!

yes, i already did that solution but i can take from different page example use this url :https://www.sciencedirect.com/science/article/pii/S0959804924007731
while doing that i got this error


For Each UI Element: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter ‘index’)

It’s working for me… @LOHITH_KUMAR_SAKA

Not throwing any exception, could you open the selectors in the Ui explorer for For each Ui element activity and share the screenshot with us.

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