Aravind Komara
Aravind Komara

Reputation: 11

How to close bootstrap popup when page loads in selenium

In my page, when page loads itself one popup is coming. I need to close that popup and perform some actions on the page. I tried in many ways but not able to close that popup, anyone please help me with code. Here I am attaching the page screenshot please find it. Page URL : https://www.chubb.com/us-en/individuals-families/find-an-agent.html

click here to see image

Upvotes: 1

Views: 344

Answers (1)

Naveen Prasath P
Naveen Prasath P

Reputation: 11

Check whether the dialog is closing when you select "close" icon which appears at the top right corner of the dialog.

If yes, then inspect that "close icon" and take that element "id or classname or xpath or cssselector"

driver.findElement(By.id("elementid")).click();

If above solution not works, then refer the below links for more information

Not able to access bootstrap modal dialog in Selenium Webdriver

How to close the Modal using Selenium WebDriver?

Upvotes: 1

Related Questions