Saturday, 23 May 2015

windowhandles.count returns count as 1 when expected 2 in Selenium

Sometimes, when we click on the link or button, another browser window opens .
Then we can switch to new window using window handle of that window.

Working on one project, I encountered some weird issue. What happened is that after new window was opened, I tried to find the count of window handles. On one machine I was getting the count as 2 while on other I was getting the count as 1. I was using a Internet Explorer 8 browser. 

All automation testers were baffled due to the issue. Then Suddenly I realized that this might be happening due to browser settings. I made below change in the security settings of the browser and it started working magically.

I enabled the protected mode for all security zones.



What do you think on above selenium topic. Please provide your inputs and comments. You can write to me at reply2sagar@gmail.com

No comments:

Post a Comment

Buy Best Selenium Books

Contributors