Close notification popup

60 views
Skip to first unread message

Akshay Goel

unread,
Apr 16, 2019, 12:20:34 PM4/16/19
to seleniu...@googlegroups.com
Hi All,

I want to close notification popup . Suggest ho can can do 

image.png

Karthik Deepan

unread,
Apr 16, 2019, 12:34:11 PM4/16/19
to seleniu...@googlegroups.com
You need to write script based on what you do manually.

In this case, you have to click on close button on the notification

Use the below code

driver.findElement(By.xpath("//i[contains(@class,'we_close')]")).click();



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJY5XAfj3u0wUwcU9RfqaAtGjb-HT%2B_K_gxS28LvtZoukGJ_CA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Akshay Goel

unread,
Apr 16, 2019, 12:52:41 PM4/16/19
to seleniu...@googlegroups.com


org.openqa.selenium.ElementNotVisibleException: element not visible


ankit garg

unread,
Apr 16, 2019, 1:19:08 PM4/16/19
to seleniu...@googlegroups.com
Even I am not able to close this random popup

Karthik Deepan

unread,
Apr 16, 2019, 1:20:25 PM4/16/19
to seleniu...@googlegroups.com
It seems there is an iframe which has to handled before we click on Close button

                driver.get("https://www.goibibo.com/");
driver.switchTo().frame("webklipper-publisher-widget-container-notification-frame");
WebDriverWait wait = new WebDriverWait(driver,20);
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@id='webklipper-publisher-widget-container-notification-close-div']"))).click();

ankit garg

unread,
Apr 16, 2019, 10:28:27 PM4/16/19
to seleniu...@googlegroups.com
Getting below error:

org.openqa.selenium.NoSuchFrameException: No frame element found by name or id webklipper-publisher-widget-container-notification-frame

Akshay Goel

unread,
Apr 16, 2019, 11:33:59 PM4/16/19
to seleniu...@googlegroups.com
I have already applied explicit wait. But it didn't work.

Mallichetty Hemanth Kumar

unread,
Apr 17, 2019, 12:25:19 AM4/17/19
to Selenium Users
Hello 

Please try below code, it's working for me

public class GoibiboCloseSymbol 
{
public static void main(String[] args) {
WebDriver driver = DriverFactory.getDriverFor("chrome");

WebDriverWait wait = new WebDriverWait(driver, 30);

//Implicit wait
//page load timeout
driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS);

//Find element timeout
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
driver.manage().window().maximize();
driver.get("https://www.goibibo.com/");
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt("notification-frame-~2514428c7"));
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@class='close']")));
driver.findElement(By.xpath("//*[@class='close']")).click();
}
}


On Wednesday, 17 April 2019 09:03:59 UTC+5:30, Akshay Goel wrote:
I have already applied explicit wait. But it didn't work.

On Wed, 17 Apr, 2019, 07:58 ankit garg <ankit...@gmail.com wrote:
Getting below error:

org.openqa.selenium.NoSuchFrameException: No frame element found by name or id webklipper-publisher-widget-container-notification-frame

On Tue, Apr 16, 2019 at 10:50 PM Karthik Deepan <karthik...@gmail.com> wrote:
It seems there is an iframe which has to handled before we click on Close button

                driver.get("https://www.goibibo.com/");
driver.switchTo().frame("webklipper-publisher-widget-container-notification-frame");
WebDriverWait wait = new WebDriverWait(driver,20);
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@id='webklipper-publisher-widget-container-notification-close-div']"))).click();

On Tue, Apr 16, 2019 at 10:22 PM Akshay Goel <goelak...@gmail.com> wrote:


org.openqa.selenium.ElementNotVisibleException: element not visible


On Tue, 16 Apr 2019 at 22:03, Karthik Deepan <karthik...@gmail.com> wrote:
You need to write script based on what you do manually.

In this case, you have to click on close button on the notification

Use the below code

driver.findElement(By.xpath("//i[contains(@class,'we_close')]")).click();



On Tue, Apr 16, 2019 at 9:50 PM Akshay Goel <goelak...@gmail.com> wrote:
Hi All,

I want to close notification popup . Suggest ho can can do 

image.png

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.

Muhad Sayef

unread,
Apr 17, 2019, 12:29:15 AM4/17/19
to seleniu...@googlegroups.com
try this

public class Test {

public static void main(String[] args){

        System.setProperty("webdriver.chrome.driver","C:\\WebDrivers\\chromedriver.exe"); 
WebDriver robot = new ChromeDriver(); 
robot.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); 
robot.manage().window().fullscreen();
robot.manage().deleteAllCookies();
robot.switchTo().frame(robot.findElement(By.id("webklipper-publisher-widget-container-notification-frame")));
robot.findElement(By.id("webklipper-publisher-widget-container-notification-close-div")).click();
}
}

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Sincerely,
Muhad Sayef
Reply all
Reply to author
Forward
0 new messages