where to add alert message in javascript code example
Example 1: simple alert program in javascript
alert("this is the alert")
Example 2: How do you handle js alerts?
If the alert on the browser comes from JavaScript, we use to
handle them Alert class.
Alert alert = driver.switchTo.alert();
alert.accept();
alert.dismiss();
alert.sendKeys();
alert.getText();