How to avoid the pop-up window in chrome browser with Selenium?

0 votes

When ever I run my script it opens the chrome browser and shows pop-up like 'browser or delete search activity data'. It's displaying two buttons like "no thanks" and "show me" buttons. This is my code, please provide any solution to help me overcome this problem.

public static void main(String[] args) throws InterruptedException {

System.setProperty("webdriver.chrome.driver", "C:\\softwares\\selenium\\webdrivers\\chromedriver.exe");

WebDriver driver=new ChromeDriver();

driver.get("http://google.com");

driver.manage().window().maximize();

driver.findElement(By.className("gb_1 gb_nd gb_od")).click();

Thread.sleep(3000);

System.out.println(driver.getTitle());

driver.findElement(By.id("fakebox-input")).sendKeys("facebook");
Aug 26 in Selenium by Naresh
57 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Selenium

0 votes
1 answer

How to open a browser window in full screen using Selenium WebDriver with C#

Simply Use this: driver.Manage().Window.Maximize(); READ MORE

answered Jun 7, 2018 in Selenium by Samarpit
• 5,130 points
3,351 views
0 votes
1 answer
0 votes
1 answer

How to scroll the Page up or down in Selenium WebDriver? (using java)

Its pretty simple. Check out the below ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,090 points
7,174 views
0 votes
1 answer

How to handle Pop-up in Selenium WebDriver using Java

Actually, its pretty simple. Use this code ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,090 points
4,280 views
0 votes
1 answer

How to handle notifications in Python with Selenium (Chrome WebDriver)

Below will help you: You can disable the ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
2,275 views
0 votes
5 answers
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
569 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
897 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
561 views