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 / Test if Button Greyed out
Power Automate
Unanswered

Test if Button Greyed out

(0) ShareShare
ReportReport
Posted on by

Hi,

I have a webpage which I want to automate.

On this page there is 2 buttons 'Start' & 'Stop'

Either button can be 'greyed out'. Both cannot be greyed out.

 

'greyed out' 'Start' button means the services are already running.

'greyed out' 'Stop' button means the services are already stopped.

 

I want to write a flow to stop the services.

 

I only want the flow to run if the 'Stop' button is NOT 'greyed out'.

How can I test if the button is 'greyed out'?

In the attached photo the 'Start' button is 'greyed out' and the 'Stop button' is not 'greyed out'.

 

Please be aware that I'm just starting in Power Automate.

As a simple example, I logged onto the application via its web page using the recorder function and inserting some time waits.

 

trakCare start stop button.png
I have the same question (0)
  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    use get details of the element in web page or get deails of ui element on window and find the status of the element you need 

     

    Hope this Helps

    Usha

  • phillip_fromoz Profile Picture
    on at

    Thanks for the info.

    This is what I did:
    I went to the web page in Chrome.

    In Power Automate, I created a 'New Flow' and picked 'Get Details of the UI Element'
    Field 'UI Element' I chose down arrow then 'Add UI Element'
    Went back to the web page and put my mouse against the STOP button
    Control Left Click
    Field 'Attribute name' I put 'Production_Stop'
    Then Save

    Under 'Variables produced' there is "AttributeValue'
    I assume this is where the button properties are held.

    Please note this button is not a standard html <button> and is a javascript snippet.

    I also have not installed any Chrome extension for 'Power Automate'

    Any ideas?

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    First of all, you will obviously need a browser extension for Power Automate. Otherwise, you won't be able to do any browser automation at all. So, if you are working with Chrome, install this: https://chromewebstore.google.com/detail/microsoft-power-automate/ljglajjnnkapghbckkcmodicjhacbfhk?pli=1

     

    Then try to simply right-click the "Stop" button in the browser and select "Inspect" so you can check it in the developer tools. Do it for both cases when it is active and when it's inactive (greyed out). Then compare the selectors you see. If you don't know how to, or don't see what's different about them, share it as screenshots here and we might be able to help you.

     

    But if you can see an actual difference in the selectors, you can use Get details of element in web page to capture the value of the specific property of the element that will then tell you if it is active or not. You can then use an If conditional in your flow based on that value.

    -------------------------------------------------------------------------
    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.

  • phillip_fromoz Profile Picture
    on at

    Thanks for the suggestion.

     

    I found the UI Element that makes up the buttons on the webpage.
    The "start" and "stop" button are hyperlinks.


    This is the html for "Start" button that is greyed out:
    a id="command_cmdStart" style="line-height:27px;" class="commandButtonDisabled" href="#" onclick="zenPage.startProduction();return false;" title="Start this Production"><nobr>Start</nobr></a>

     

    This is is the html for "Stop" button that is NOT greyed out:

    <a id="command_cmdStop" style="line-height:27px;" class="commandButton" href="#" onclick="zenPage.stopProduction();return false;" title="Stop this Production"><nobr>Stop</nobr></a>

    Is there any way of interogating the "class" attribute in the hyperlink from Power Automate?
    class="commandButton" <- not disabled

    class="commandButtonDisabled" <- disabled

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You can use the Get details of element in web page and select Class as the attribute to get. 

    -------------------------------------------------------------------------
    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.

  • phillip_fromoz Profile Picture
    on at

    Thanks

    When I chose the element "non breaking 'Stop'" -> Edit -> A panel came up with Attribute 'Class'

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    I'm not sure I follow you here. Can you share a screenshot of what you mean?

  • phillip_fromoz Profile Picture
    on at

    Thanks.

     

    I added the UI element which I can see on the right side of the Power Automate screen.

     

    However when I try to test the UI element with the 'if' statement it says "No UI Elements" - see screenshot
    Why?

    The UI element was added by:
    1. Select "Add UI Element" on right side of screen

    2. Go over to my webpage on Chrome

    3. Hover over the "Stop" button

    4. Control Left click 

    NoUI_Element.png
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    That's because you're using an action called If window which is designed to only check for "window" type elements. It does not support elements within windows or web pages. 

     

    You should use an action called If web page contains instead.

    -------------------------------------------------------------------------
    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard