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 8, 2019 in Selenium by Anjali
• 2,950 points
3,628 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 8, 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 4, 2019 in Selenium by Priti
9,908 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,500 points
8,407 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,500 points
997 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 6, 2018 in Selenium by nsv999
• 5,500 points
10,608 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 13, 2018 in Selenium by nsv999
• 5,500 points
948 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
809 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,500 points
13,773 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,190 points
9,188 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,910 points
7,263 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 3, 2020 in Selenium by Sri
• 3,190 points
7,902 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP