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

Community site session details

Session Id : yeAysc5SiXXb9l7TsVuiF/
Power Automate - Power Automate Desktop
Unanswered

Test if Button Greyed out

Like (0) ShareShare
ReportReport
Posted on 6 Dec 2023 03:18:31 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.

 

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on 14 Dec 2023 at 08:10:26
    Re: Test if Button Greyed out

    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.

  • phillip_fromoz Profile Picture
    on 13 Dec 2023 at 23:33:29
    Re: Test if Button Greyed out

    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 

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on 13 Dec 2023 at 07:19:47
    Re: Test if Button Greyed out

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

  • phillip_fromoz Profile Picture
    on 10 Dec 2023 at 22:47:14
    Re: Test if Button Greyed out

    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 08 Dec 2023 at 06:58:10
    Re: Test if Button Greyed out

    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 08 Dec 2023 at 00:12:19
    Re: Test if Button Greyed out

    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 07 Dec 2023 at 04:28:45
    Re: Test if Button Greyed out

    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 07 Dec 2023 at 01:15:40
    Re: Test if Button Greyed out

    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?

  • UshaJyothiKasibhotla Profile Picture
    73 Moderator on 06 Dec 2023 at 05:11:16
    Re: Test if Button Greyed out

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading started
Loading complete