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 in Selenium by Anjali
• 2,930 points
49 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 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 in Selenium by Priti
1,563 views
0 votes
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,110 points
2,310 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,110 points
189 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,110 points
5,030 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,110 points
42 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,650 points
78 views
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,110 points
1,006 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
1,153 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
891 views