A window handle sometimes of type int and other times of type IntPtr
int example:
[DllImport("user32.dll")]
static extern uint GetWindowThreadProcessId(int hWnd, int ProcessId);
IntPtr example:
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hWnd, …
Here comes 2 windows pop out during the testing.
my code:
string BaseWindow = driver.CurrentWindowHandle;
ReadOnlyCollection<string> handles = driver.WindowHandles;
foreach(string handle in handles)
{
Boolean a = driver.SwitchTo().Window(handle).Url.Contains("Main");
if (a == true)
{
InitialSetting.driver.…