Interacting with Web Elements in Power Automate

Thabiso MbathaThabiso Mbatha
2 min read

As I progressed in my Power Platform journey, I tackled interacting with web elements in my ClubFlow project. The goal was to filter Premier League club data for the 2024/25 season by simulating user clicks on the website’s filter interface.

Clicking Web Elements

The flow uses three WebAutomation.Click.Click actions to:

  1. Open the filter menu: Click the "Filter By:" button using the selector appmask['Web Page \'https://www.premierleague.com/en/clubs\'']['Button \'Filter By:\''].

  2. Select the season: Click the "2024/25" label with the selector appmask['Web Page \'https://www.premierleague.com/en/clubs\'']['Label \'2024/25\''].

  3. Save the filter: Click the "Save" button with appmask['Web Page \'https://www.premierleague.com/en/clubs\'']['Button \'Save\''].

Each action uses:

  • ClickType: LeftClick to mimic a standard mouse click.

  • MousePositionRelativeToElement: MiddleCenter for precise targeting.

  • WaitForPageToLoadTimeout: 60 seconds to ensure the page updates after each click.

Control Repository

The appmask selectors come from the provided Control Repository, which defines UI elements using attributes like Class, Id, and Ordinal. For example, the "Filter By:" button is identified by its button tag and chip class, ensuring PAD clicks the correct element.

Challenges and Learning

Crafting reliable selectors was tricky. I learned that dynamic websites, like the Premier League’s, require robust selectors to handle potential changes in the Document Object Model. This experience is directly applicable to automating social media posts, where I’ll need to interact with buttons like "Post" or "Share."

Reflection

This step taught me the importance of precision in web automation. Simulating user clicks felt like bridging manual processes with code, a skill I’m excited to apply to my daily posting automation.

10
Subscribe to my newsletter

Read articles from Thabiso Mbatha directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Thabiso Mbatha
Thabiso Mbatha