How can I send some data to a Prompt Alert box using Selenium Webdriver?

0 votes
How can I send some data to a Prompt Alert box using Selenium Webdriver?
Jul 2, 2019 in Selenium by Abhishek
1,939 views

1 answer to this question.

0 votes

Hey Abhishek, you can use sendKeys() method send some data to a Prompt Alert Box in Selenium Webdriver. sendKeys() method takes String as an input and is mostly used to send keyboard inputs in Selenium Webdriver. Checkout the following command to send data to alert box:

driver.switchTo().alert().sendKeys("Dummy_text");
answered Jul 2, 2019 by Abha
• 27,930 points
How to enter multiple values in a popup box?

When i am prompted for both username and password

Try this:

var alert = driver.SwitchTo().Alert();

alert.SetAuthenticationCredentials("username", "password");

alert.Accept();

Related Questions In Selenium

0 votes
1 answer

How can I clear the text in a text box using Selenium WebDriver?

Hello Akriti, you can clear the text ...READ MORE

answered May 29, 2019 in Selenium by Anvi
• 14,090 points
1,002 views
0 votes
1 answer

How can I store data into a cookie using Selenium Webdriver?

Hey Abhilasha, we can load a website ...READ MORE

answered Jun 19, 2019 in Selenium by Anvi
• 14,090 points
923 views
0 votes
1 answer
0 votes
1 answer

How can I locate web elements from a web page using Selenium Webdriver?

Hey @Dushyant, Locating elements in WebDriver is ...READ MORE

answered May 28, 2019 in Selenium by Shreya
783 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,510 points
3,192 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,890 points
2,386 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,890 points
2,541 views
0 votes
1 answer

How can I select date from a datepicker div using Selenium Webdriver?

Hey Jeevika, you can use following automation ...READ MORE

answered Jul 15, 2019 in Selenium by Abha
• 27,930 points
6,385 views
0 votes
1 answer

How can I read a CSV file in Selenium using Webdriver?

Hey Trisha, you can read a CSV ...READ MORE

answered Jul 17, 2019 in Selenium by Abha
• 27,930 points
4,117 views