We are facing some issue in switching to new window after clicking on the link/button
I was using the below code for switching to new window.
elem.click();
for (String winHandle : driver.getWindowHandles()) {
driver.switchTo().window(winHandle); }
Observed that scripts runs inconsistently, It will be great if i get some consistent code for switching to new window. I feel there is a synchronization issue while switching to new window.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…