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
123 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,325 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,518 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
333 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,591 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
133 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
183 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
3,791 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

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

answered Aug 31 in Selenium by Sri
• 2,970 points
4,774 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
2,752 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 in Selenium by Sri
• 2,970 points
3,113 views