2

enter image description here

I want to handle the notification popup in jabong website using selenium.

tsr_qa
  • 623
  • 3
  • 8
  • 27

1 Answers1

5

You cannot control this kind of "popup" via Selenium directly.

What you can do is to:

  • disable all push notifications for the browser session entirely:

    FirefoxProfile ffprofile = new FirefoxProfile();
    ffprofile.setPreference("dom.webnotifications.enabled", false);
    WebDriver driver = new FirefoxDriver(ffprofile);
    
  • load the existing profile in which you had pre-set up the desired behavior for the push notifications for this site:

FYI, when you configure push notifications in the browser, Firefox inserts/updates a site-specific record inside permissions.sqlite SQLite database file which you can find inside the profile directory.

Community
  • 1
  • 1
alecxe
  • 441,113
  • 110
  • 1,021
  • 1,148