Random clicking in the wrong place

I have and issue that is driving me crazy.

I have a process that clicks in the below button ‘New’. Half of the times clicks there correctly
new

But half of the times it clicks on the Microsoft Square on the top left corner. Of course, this causes for the browser to open Microsoft window and the process fails
Screenshot 2020-11-26 183249

After clicking the ‘New’ button I’m doing a highlight & Print screen (in parallel) and I have also captured and error:
Highlight: The UI element you are trying to highlight is valid, but not visible.

I’ve tried different selectors, different machines, servers, robots,… the problem happens randomly.

I guess the selector being ‘not visible’ is maybe a clue, but I don’t know how to make it work reliably. Any ideas?

Hi @selrac,

I remember this happening constantly in a BluePrism robot when interacting with a PowerBI website as well. Microsoft probably wants to avoid bots. I feel your pain!

Ok, that said, I do not have access to Dynamics to help you with a solution workflow. Here is my suggestion.

  • Have a Retry scope for the click (Action) event which checks for an element either New or (Alt+N).
  • If that element does not exist, then refresh the page and try again (click).
  • In the retry loop you could start with 3 retries and see how reliable it can be.

And you could also use try-catch method for handling the resulting exception. Just ensure that these loops of retries and try-catch do not go into an infinite loop.
Something like this:

Cheers!

1 Like

Hi @selrac

May the reason be the loading of page issue so that robot couldn’t identify the button to be clicked and did click on wrong button

Put a delay activity before click activity

Hope it helps you

Regards
Nived N :robot:

Happy Automation :slight_smile::slight_smile::slight_smile:

Thanks @jeevith, what I don’t understand is what to use as a condition. I guess I should check for the ‘hidden’ selector, but I can not capture it, I mean I don’t know really what to look for.

Use get attribute activity to check if element is visible and ready to be clicked

1 Like

After looking at your screenshot - try to enable “innertext=New”

1 Like

@selrac, you are very close!

aaname or innertext from Get attribute activity. If the aaname or innertext is not “New” then try again and click again.

Action:
Click on “New”

Condition:
Use Find Element Exists Activity and check if the element exists - that small window after click (with “New” as aaname in the selector)

1 Like