Reputation: 41
I am using TestStack.White for automating a test on an existing application.
I have received a particular AutomationID "example_ID"
for an element using Inspect.exe, however when I am using
var something = window.Get(SearchCriteria.ByAutomationId("example_ID");
it says that it failed to get an element with the given ID. Any pointer would be helpful.
Upvotes: 4
Views: 553
Reputation: 51
Does your automation-code run with the same privileges as your Inspect.exe-Instance? Maybe it has no access to the GUI you want to automate:
https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/user-account-control-allow-uiaccess-applications-to-prompt-for-elevation-without-using-the-secure-desktop states: "However, there might be times when an administrative user runs an application with elevated privilege based on UAC in Admin Approval Mode. Microsoft UI Automation cannot drive the UI graphics of elevated applications on the desktop without the ability to bypass the restrictions that UIPI implements."
Upvotes: 0