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 / Can't Click Web Button
Power Automate
Unanswered

Can't Click Web Button

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Tyron_0-1611578130722.png

 

Robin.Core.ActionException: Button-press failed. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Robin.Modules.WebAutomation.Actions.WebAutomationRuntime.PressButtonOnWebPage(WebBrowserInstanceVariant webBrowserInstanceVariant, TextVariant cssSelectorOfButtonToPress, Boolean waitForPageToLoad, TextVariant dialogButtonToPress, WebPageCourseOfActionIfDialogAppearsEnum courseOfActionIfDialogAppears)
at Robin.Modules.WebAutomation.Actions.WebAutomationActions.PressButtonOnWebPage(Variant webBrowserInstance, Variant cssSelectorOfButtonToPress, Variant dialogButtonToPress, Boolean waitForPageToLoad, Int32 courseOfActionIfDialogAppears)
--- End of inner exception stack trace ---
at Robin.Modules.WebAutomation.Actions.PressButtonBase.Execute(ActionContext context)
at Robin.Runtime.Engine.ActionRunner.RunAction(String action, Dictionary`2 inputArguments, Dictionary`2 outputArguments, IActionStatement statement)

 

The pic above shows the error message. I have tried numerous workaround including:

1. Move mouse and click command

2. Changed the command to click radio button

3. Edit the UI element (Name is not selected)

4. There are 9 selectors and 5 subsections in the edit UI Element so not sure what to try and change to get the button to work

 

Please assist

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Surely I can't be the only one struggling with Null Reference Exceptions on webpages. I have tried a different flow on a different site and get the same issue. Some elements are fine, and some just dont work. Hard to use a new platform when there are no solutions via the community. I have used UI Path and the responses are exceptional and makes this product look bad.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Same exact issue here after upgrading the PAD software. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I spent an hour on the line to the Microsoft helpdesk with no definitive solution. Instance error reoccurs on different sites and the solution provided is hit and miss. Try using the desktop recorder to press the button required. I find that works better eventhough a defined web element should be the correct solution.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried that as well - no dice. Still throws a Button-press failed once it gets to that step even using the recorder. With the:
    Object reference not set to an instance of an object.: Robin.Core.ActionException: Button-press failed. ---> System.NullReferenceException: Object reference not set to an instance of an object.
    at Robin.Modules.WebAutomation.Actions.WebAutomationRuntime.PressButtonOnWebPage(WebBrowserInstanceVariant webBrowserInstanceVariant, TextVariant cssSelectorOfButtonToPress, Boolean waitForPageToLoad, TextVariant dialogButtonToPress, WebPageCourseOfActionIfDialogAppearsEnum courseOfActionIfDialogAppears)
    at Robin.Modules.WebAutomation.Actions.WebAutomationActions.PressButtonOnWebPage(Variant webBrowserInstance, Variant cssSelectorOfButtonToPress, Variant dialogButtonToPress, Boolean waitForPageToLoad, Int32 courseOfActionIfDialogAppears)
    --- End of inner exception stack trace ---
    at Robin.Modules.WebAutomation.Actions.PressButtonBase.Execute(ActionContext context)
    at Robin.Runtime.Engine.ActionRunner.RunAction(String action, Dictionary`2 inputArguments, Dictionary`2 outputArguments, IActionStatement statement)

  • HEATFreight Profile Picture
    1,024 on at

    I'm getting a dropdown menu that only works once. Other dropdowns on this web page worked as many times as I run the flow (AFTER EDITING THE SELECTOR), but this one dropdown is quit persnickety. I can get the PAD web automation action to change it by index or value (and it turns yellow and works ONCE). But the element is dynamic and hard to reference on subsequent runs. I have tried the same selector edits as the other dropdowns and buttons and whatnot, but all my tricks fail!

     

    Object reference not set to an instance of an object.: Robin.Core.ActionException: Failed to select option(s). ---> System.NullReferenceException: Object reference not set to an instance of an object.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It gets worse!! The new version of PAD made all my flows not work. I had a solid workaround whereby I use the desktop recorder to click where I need it to click. That function has now changed and the desktop recorder is now just a semi automated process of doing the same old click element function which surprise surprise still throws the null exception error. Very disappointing. I spent an hour on the phone to Microsoft tech to try fix ONE ELEMENT that wasn't working. There could be loads in every flow. And every "solution" they tried doesnt necessarily work for the next null exception error. PLEASE just revert to the old desktop recorder where I can get the mouse to just click a position rather than pick up flaky website buttons!

  • HEATFreight Profile Picture
    1,024 on at

    Don't use the recorder! I just got really good at knowing which actions to try and knowing how to test different actions to find the best one.

    For instance, any web automation (where you are interacting with a web page) should use mostly "Web Automation" type actions -as opposed to "UI Automation" type actions.

    Web Automation actions are the ones that highlight fields in yellow as they interact with them. These actions can happen with your browser window minimized -no problem!

    Any element that fits under the Windows user interface umbrella generally requires a UI Automation type of action. Get used to the difference. The Web vs. UI types have many analogous actions, like clicking buttons or drop-downs and filling text fields and selecting radio buttons etc, but they are not the same. Get them mixed up and you will have problems.

    However, if you are having issues with one type of action, it often pays to try the other type. I have found many ostensibly "web" type elements that would not work unless I used UI Automation actions that typically only apply to elements falling under that Windows user interface umbrella. I do not think the reverse applies... You probably won't have much luck using web automation actions on Windows UI elements.

    So, there is a reliable and rigorous way of manually building PAD flows by stepping through the actions and tagging elements as you go. Use the desktop recorder to get a feel for the types of actions that you should be using, but build your flows entirely on your own. Manually adding actions has worked great for me! I never had much luck with the recorder anyway. Use "Run from here" to save yourself time and quickly iterate through several test runs of unreliable actions until you have the selectors dialed in. You may have to manually edit your selectors to make them less specific, in the case of dynamic web content that has a different selector every time.

    Also, USE THE SCROLLWHEEL!

    USE THE SCROLLWHEEL!

    USE THE SCROLLWHEEL!

    USE THE SCROLLWHEEL!

    --

    I cannot reiterate this enough: USE THE SCROLLWHEEL!

    When you are in the element selector -where UI and web elements are highlighted by a red box as you hover over them- you can use your scrollwheel to step through stacked elements so you can find the exact right element and so you can see hidden elements that are hard to select. Scrolling your finger forward/up takes you higher up in the source code of the web page, to more top level elements. Scrolling back/down takes you to the bottom level element, the deepest nested element over which your cursor is hovering.

    I promise that if you spend some time experimenting with selecting different elements with different actions, you will get a feel for it all, and the result will me a faster and more reliable flow.

    Also, you can easily step through your existing flows and re-select any failed selectors that are giving you errors (well, to the extent that you are able to remember which element you were using in the first place). Then once your flow is free of pre-runtime errors, run it and step through the errors and hangs, reselecting elements as you go or editing their selectors.

    Any time you have an action that works once but does not work on subsequent runs, you are in good shape! That is a good position to be in. I think it's easier to deal with that than actions that you can't even get to work once, although the troubleshooting steps may be similar.

    If the action works exactly once, but fails whenever you reload the web page, then you are in a "edit the selector" situation. Find that element and click the "edit selector". Then you need to check for items with random looking numbers. If you see something like "iFrame = frameID_93854890174", what you want to do is go edit that selector criteria and change the "equals" drop-down to "starts with" and then delete off the number, leaving "iFrame = frameID_". After that, the action should work on every subsequent run. Don't edit the selector directly except as last resort. That's where you double click the code at the bottom and you can edit the entire string of selector code at once. Avoid that except when all else fails. The proper way to do it is to find the checkbox line where a particular piece of selector code is built, and change that one item by editing the equation. Only items with the blue checkbox checked will show up in the selector code. You can check or uncheck at will, but that is not likely to help much. What you have to do is look for overly specific selector code and try to make it less specific. You may have to toggle off some of the checkboxes and rarely you may have to toggle a checkbox on, or you may just have to change the equation a bit, like with the iFrame ID situation above. There are usually quite a lot of selector element checkboxes in this section. It's quite overwhelming. So in general, you want to make your selector code LESS specific, not more. If the action runs once but fails after page reload, reducing selector specificity should help you. There may be other situations, say where the action won't even run once, in which you should actually make the selector more specific by checking unchecked boxes and whatnot. Mostly in my experience I am reducing selector specificity, not the other way around.

    So take it from me, teach yourself how to fish and you'll never go hungry! Stop using the desktop recorder!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @HEATFreight 

     

    Many thanks for your comprehensive reply. I will work through the above and try it out.

     

    I certainly agree workarounds aren't the solution, however a basic webclick flow is the start of the process for the work I am doing so cannot spend too long trying to ensure every UI element parameter is reviewed / changed. 

     

    Your assistance is appreciated! Thank you for contributing, I am sure it will help me and many others on this forum.

  • HEATFreight Profile Picture
    1,024 on at

    It's easier than you think. Seems overwhelming at first until you have some sense of what's going on.

    Also, get Microsoft support on the phone! I have had great experience requesting support calls for Power Automate. I've had hour long calls with Shanghai, New Delhi, Mumbai, Barcelona, etc. The support folks are always super knowledgeable, and 100% of the time they have successfully helped me fix whatever Power Automate / PAD issues I was having. Seriously, Microsoft is "batting a thousand" at supporting me! Super impressed with the entire Power Automate platform. Good luck getting such great service with Google Cloud!

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi, my little cheat / tip is to think like you are an end user clicking or selecting buttons.  If you are using a drop down and want to select a field called person, literally pass the keys p e r s o n via the keyboard and hit {return}.  Then you don't need to worry if it's a dynamic list.  Not good if you have similar fields mind you, but sometimes I try to emulate the shortcuts that I use as an end user. 

     

    It's like when the list is of all the countries and united kingdom is near the end, I start typing u n i t e d   k and soon as I get there, united kingdom is ready to be selected.

     

    Let me know if that works for you.

     

    Damien

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard