Eugene
Eugene

Reputation: 5543

How could I find an application window via it's ClassID?

I'm using White for test automation. I had created simple application test, which is tracking an application via it's dialog name.

var appCalc = Application.AttachOrLaunch(new ProcessStartInfo("application.exe"));
var wndCalc = appCalc.GetWindow("Dialog caption");

But this approach is unstable, because in different localisations, the caption could differ. How could i track my application, using it's ClassID?

Upvotes: 1

Views: 1458

Answers (1)

MishaU
MishaU

Reputation: 708

    var wndCalc = appCalc.GetWindow(SearchCriteria.ByNativeProperty(AutomationElement.ClassNameProperty, "Your class name"), InitializeOption.NoCache);

Upvotes: 1

Related Questions