window-handles

Best way to keep track and iterate through tabs and windows using WindowHandles using Selenium

心不动则不痛 提交于 2019-11-25 20:05:11
We are working with Selenium webdriver to make UI tests for Internet Explorer 11. In the tested webapplication there are several screens popping up. In several tests we end up with three browserswindows, so also three Driver.WindowHandles. To switch from one WindowHandle to the other we expected that Driver.WindowHandles would be sorted like the oldest windows first and the newest windows last. But this is not the case: It is totaly random! Because a windowhandle is a GUID we ended up creating a dictionary with the WindowHandle GUID as key with the value of the type of page which is loaded in