0 votes
in Selenium by
Which command to be used to get the text from Alert message popup

a) Alert alert = driver.switchTo().alert();

String message = alert.getText();

b) SwitchAlert alert = driver.switchalert();

String message = alert.getText();

c) Alert alert = driver.switchalert();

String message = alert.getText();

1 Answer

0 votes
by

Alert alert = driver.switchTo().alert();
String message = alert.getText();

...