Selenium webdriver window handles c# switchTo failed

后端 未结 5 1245
广开言路
广开言路 2021-02-10 02:11

Here comes 2 windows pop out during the testing.

my code:

string BaseWindow = driver.CurrentWindowHandle;                 
ReadOnlyCollection

        
5条回答
  •  长情又很酷
    2021-02-10 02:40

    string NewWindowHandle = string.Empty;
    ReadOnlyCollection windowHandles = driver.WindowHandles;
    NewWindowHandle = windowHandles[windowHandles.Count - 1];
    driver.SwitchTo().Window(NewWindowHandle);
    

提交回复
热议问题