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

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

Hi Brett,

you can use sendKeys() method to 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 the alert box:

driver.switchTo().alert().sendKeys(“Dummy_text”);