How to make UI Automation click a button with no id?

1.1k views Asked by At

Im using TestStack.White as a UI Automation for c# and I have ran into a problem.

I need to click a save as button but Visual UI tells me it doesnt have a AutomationId.

My current code is

Application manager = Application.Launch("PATH");
Window mainWindow = manager.GetWindow("ReportViewer");
mainWindow.Get<Button>(SearchCriteria.ByText("Save As")).Click();

and I get a error saying it cannot find the button

Is there any workaround for this?

0

There are 0 answers