web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Dynamic Selector in we...
Power Automate
Answered

Dynamic Selector in web Automation

(0) ShareShare
ReportReport
Posted on by 39

How to change the populate text of web page selector as the input field get changed as page get reloaded. Help out with any handling method of selectors to achieve the task

 

 

@selectors

 

I have the same question (0)
  • PetrosF-MSFT Profile Picture
    on at

    Hi @soumiya 

     

    You could achieve that by manipulating the selector and making it more "generic".

     

    First you have to inspect the selector extracted from multiple instances of the web page and determine what remains the same in every instance. Then, you can edit the CSS selector and modify the operator of the attribute that changes accordingly:

    PetrosF-MSFT_0-1602501198223.png

     

    Also, you could add an additional "fallback" selector by separating the two CSS selectors by a comma.

     

    I hope the above helps!

     

  • soumiya Profile Picture
    39 on at

    Thanks for your reply...

    But i am not still more clear i am trying to work on RPA challenge where the input text field keeps on changing in that class remains constant where as ordinal number gets changed what to do help me out with some solutions 

  • adijain Profile Picture
    Microsoft Employee on at

    Hello @soumiya,

     

    Since the class remains constant, you would need to customize the selector to only look for the class attribute value and deselect the remaining attributes (name, ordinal, innerText , etc.) to enable PAD to find the element consistently.

     

    Please follow the steps below to edit a selector:

    • Search for the element that needs to be edited in the UI elements pane.

    Capture.JPG

     

    • Right click on the element and go to edit selectors.

    Capture2.JPG

     

    • Hover over the selector captured and right click on it to open the selector builder to edit it.

    Capture3.JPG

     

    • This will open up the selector builder which can be used to easily customize the selector as appropriate. In your case you would need to only select the class attribute because it remains constant and deselect the ordinal and InnerText attributes as they are dynamic.

      Capture4.JPG

     

    Further, if the above does not resolve your issue, please send us the selector path of the target element and the URL where it exists so that we can provide a solution. 

     

    Thank you for trying Power Automate Desktop.

     

  • soumiya Profile Picture
    39 on at

    Thanks for your support,

     

    I have tried the way that you had mentioned. Still the error comes. The selector error i have attached and also the url that i am trying to automate is www.rpachallenge.com. Thanks in advanced.

    soumiya_0-1602563387255.png

     

  • Verified answer
    adijain Profile Picture
    Microsoft Employee on at

    Hello @soumiya

     

    RPA challenge website is dynamic in a way that it moves the field elements every time it is loaded. But, the important to note there is that the other div of the element always contains consistent field labels ("Address", "First Name", "Company name", etc.). To target the correct element each time please customize the selector (as mentioned before) so that it looks for the field names and then the input field to populate it - for example like below:

    • For Address:
      •  adijain_0-1602694768320.png
      • First name selector: div:contains("First Name") > input
      • Similarly you can change the text inside contains operator to find any input field names you want. (Role in Company, Last Name, Company Name, Email, Phone Number, etc) 

      Hope it helps.

  • soumiya Profile Picture
    39 on at

    Thanks for your support @adijain 

    It works

  • soumiya Profile Picture
    39 on at

    Hi @adijain 

    I am facing an other issues on clicking the start button on RPA challenge website tried with all the selector possible still not able to achieve it.

    body > app-root > div[Class="body row1 scroll-y"] > app-rpa1 > div[Class="row parent"] > div[Class="instructions col s3 m3 l3 uiColorSecondary"] > div:eq(5) > button[Class="waves-effect col s12 m12 l12 btn-large uiColorButton"][Type="submit"]

     

    <button _ngcontent-c1 class="waves-effect col s12 m12 l12 btn-large uiColorButton">Start</button>

    These are some selectors i tried but still not working

  • adijain Profile Picture
    Microsoft Employee on at

    Hello @soumiya, Looks like that button is dynamic as well, please utilize the below selector to click on the start button:

    adijain_0-1602789488183.png

     

  • soumiya Profile Picture
    39 on at

    Thanks for your support @adijain 

    it works fine

  • Chandrasekaran1 Profile Picture
    4 on at

    Hi,

     

    When i try to autmate the google search button,each time the selector generated is different . I tried to edit the selectors but not able to run.Can anyone tell me the solution.When i try to use press button ita not working.

     

    Thanks in advance

     

     

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard