I am getting a pop up as displaying in the attached screen shot when i am accessin the site using IE.I have to click on ‘Show all Contents’ in the pop up to access the site further.Please give give input on how to handle this pop up
Selenium Webdriver allows us to identify a pop up window by using its name attribute.
Save the Windowhandle of Parent browser window by using driver.getWindowHandle()
Then switch to the help popup browser window – driver.switchTo().window(“Window which has showall contents”)
Or use the following syntax
Set <String> windows = driver.getWindowHandles() and try to get the window which matches the title attribute of your window.
Hope this helps.
In case there is no name attribute nor title get all the windowhandles
Set<String> windows = driver.getWindowHandles()
if(driver.getPageSource().contains(“show all contents”))
//which ever button you want to click