Handle web-based popups

0 votes
There are pop-ups that disturb the script I wrote to automate a task using selenium. Are there ways to handle these pop-ups? I am new to selenium and have just started working with it. Can someone help?
Jan 7, 2019 in Selenium by Anjali
• 2,950 points
231 views

1 answer to this question.

0 votes

This happens with me also. I did find the solution though.

There are four methods of the effective Web-based pop-up handling:

  • string getText() method returns the text displayed on the alert box
  • void accept() method clicks on the “Ok” button as soon as the pop-up window appears
  • void dismiss() method clicks on the “Cancel” button as soon as the pop-up window appears
  • void sendKeys(String stringToSend) method enters the specified string pattern into the alert box
Hope it helps.
answered Jan 7, 2019 by Fuji
So technically what is the solutoin. what steps do we have to do now?

Related Questions In Selenium

0 votes
1 answer

Is it possible to handle Windows based pop-ups in Selenium?

Hello Rustam, Selenium doesn’t support windows based ...READ MORE

answered Jun 3, 2019 in Selenium by Priti
7,611 views
+1 vote
1 answer

How to handle drop downs using Selenium WebDriver in Java

First, find an XPath which will return ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,520 points
4,841 views
0 votes
1 answer

Web-scraping with beautifulsoup in different siblings

The tags are not closed in your ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,520 points
370 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,520 points
7,897 views
0 votes
1 answer

I need to find a web element using CSS

The element should be located with any ...READ MORE

answered Apr 12, 2018 in Selenium by nsv999
• 5,520 points
153 views
0 votes
1 answer

Selenium Alternatives: Is there a tool like Selenium for testing web pages but which does not involve coding.

I'm guessing you've tried Selenium IDE already. ...READ MORE

answered Apr 13, 2018 in Selenium by king_kenny
• 3,710 points
201 views
0 votes
2 answers

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,520 points
4,316 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,010 points
5,236 views
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,890 points
3,124 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2, 2020 in Selenium by Sri
• 3,010 points
3,615 views