Getting an error "ElementNotFound: Element not found with locator 'app-bar-86fcd49b-61a2-4701-b771-54728cd291fb'" when trying to access element using id for desktop teams application

below code is written to access teams desktop application

found Automation id using accessibility insight tool

But getting error "ElementNotFound: Element not found with locator ‘app-bar-86fcd49b-61a2-4701-b771-54728cd291fb’ " .
I have tried in different ways but still facing same issue

Can anyone suggest what to do?

Looking over the documentation it’s worth noting the below:

  • Make sure your display scaling is set to 100%, otherwise you might encounter issues when clicking or interacting with elements. (since offsets and coordinates get distorted)
  • Disturbing the automation (like interacting with your mouse/keyboard) or having other apps obstructing the process interacting with your app of interest will most probably affect the expected behaviour. In order to avoid this, try controlling the app’s main window right before sending clicks or keys. And keep targeting elements through string locators, as interacting with Windows element objects previously retrieved will not work as expected in a future altered state of the app (changes under the element structure).

I personally have never used RPA.Windows library

It’s also worth casting over the Click arguments.

I hope this helps.

Is possible that ApplicationId is change every time?
Can you check the class or name of button?
For identify one element you can use and operator like this.
Click type:Button and