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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Error: Button with Sel...
Power Automate
Answered

Error: Button with Selector not Found

(0) ShareShare
ReportReport
Posted on by 200

Hello all,

 

I have a UI element for a button that looks like this:

> frameset > frame[src="/epitomax/episode/Admission.jsp?episode_id=%EpisodeID%&case_no=100578&episode_type=admission&extra_arg=null"] > html > frameset > frame[src="/epitomax/episode/AllForms.jsp?episode_id=%EpisodeID%&MAX_ROWS_OVERRIDE=FALSE&ALLFORM_DEFAULT_FORM_TYPE_FILTER='PROGRESS NOTE'"] button[Id="btnAll"]

When I test the selector by typing in the variable %EpisodeID% it works and can find the selector. However, during the actual flow I parse the variable out and it fills in. This always fails. The output is correct as I can see in the error message that the correct episode id is selected.

 

Error Messsage

Correlation Id: 3107f6da-e341-41d6-8330-273f6de7f6b3

Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Button with selector '> frameset > frame[src="/epitomax/episode/Admission.jsp?episode_id=12345
&case_no=100578&episode_type=admission&extra_arg=null"] > html > frameset > frame[src="/epitomax/episode/AllForms.jsp?episode_id=12345
&MAX_ROWS_OVERRIDE=FALSE&ALLFORM_DEFAULT_FORM_TYPE_FILTER='PROGRESS NOTE'"] button[Id="btnAll"]' not found.
at Microsoft.Flow.RPA.Desktop.Modules.WebAutomation.Actions.PressButtonBase.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @apaulso9 

     

    seems like this kind of question has been discussed earlier in community.

     

    I think you need to enable Text Editor option 

     

    Nived_Nambiar_0-1695438653014.png

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

     

     

  • apaulso9 Profile Picture
    200 on at

    Hi,

     

    I already have. That is how I changed the text to be my variable. However, it correctly prints the selector but doesn't recognize it. 

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @apaulso9 

     

    Could you show how you have written the selector 🙂

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • apaulso9 Profile Picture
    200 on at

    Absolutely! thank you very much for your time.

    Here is the modified selector:

    apaulso9_0-1695736763798.png

    In text: 

    > frameset > frame[src="/epitomax/episode/Admission.jsp?episode_id=%EpisodeID%&case_no=100578&episode_type=admission&extra_arg=null"] div[Id="tab_div"] > ul > li > a[Text="Forms"]

     

    Here is the output and error:

    apaulso9_1-1695737089314.png

     

    Here is the unmodified selector that works (only for the single episode id):

    apaulso9_2-1695737553183.png

     

     

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @apaulso9 

     

    One question , when you use the same selector which is failed while finding (with exact values) is it indicating the correct element ?

     

    Also try this too, convert that %EpisodeNo% variable to number and then use that conversion output in selector, see whether that works ?

     

     

  • apaulso9 Profile Picture
    200 on at

    It does, however, I think this has answered the questions of what is going wrong. I use a python script to print the number. Somehow Power automate is adding a second blank line when it stores the variable. Thus, I can't convert it to a number or use it in the selector text. Do you have any idea how to circumvent this? I am striping the python value, so I know the print statement itself does not have the extra line. 

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @apaulso9 

     

    You can use .Trimmed method on that variable which is coming out of the script , may be that would help to remove the blank line.

     

    Also one question , are you using any print statement apart from one used to print the variable ?

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • apaulso9 Profile Picture
    200 on at

    I am not, I split the current URL I am in, here is my statement:

    apaulso9_0-1695752655700.png

    I have confirmed that the trim function works and returns the correct number of variables. This did not fix the selector issue. Thank you for the idea though!

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    @apaulso9 wrote:

    I am not, I split the current URL I am in, here is my statement:

    apaulso9_0-1695752655700.png

    I have confirmed that the trim function works and returns the correct number of variables. This did not fix the selector issue. Thank you for the idea though!


    I did not get what you meant by this what i have highlighted above ?

     

    Also one question why are you using python for the above split, i think you can do same via PAD actions 

     

    Also while printing url2 , could you try this code instead ?

    print(url2.strip())

     

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

     

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You could also use Split text to split the URL if that is something you actually need or simply Parse text with regular expressions to get a specific value from the URL.

    Regardless, Python will always print it out with an extra new line to PAD. That's the way Python scripts work in PAD. Applying any stripping/trimming in the Python script will not change that. You need to trim the text in PAD after outputting it from Python. Use Trim text on the Python script output to do it.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 253 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 172 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 134 Super User 2026 Season 2

Last 30 days Overall leaderboard