Luke101
Luke101

Reputation: 65298

How to get the window Id of a window in the White library

I am trying to get a window id from the White framework. I would like to store the id in a database then later attach to the window again. Here is the code I am working with:

var psi = new ProcessStartInfo(_path);
_application = White.Core.Application.AttachOrLaunch(psi);
_window = _application.GetWindow(SearchCriteria.ByText(_title), InitializeOption.NoCache);
var id = _window.Id;

As you can see var id = _window.Id; returns a null value. Do you know of any way to refer to a window?

Upvotes: 0

Views: 1167

Answers (1)

Jake Ginnivan
Jake Ginnivan

Reputation: 2142

Use the window title to get the window every time, there is no performance difference afaik using the title vs the automation id for finding windows.

Upvotes: 1

Related Questions