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();

Related questions

0 votes
asked Feb 2, 2021 in PHP by SakshiSharma
0 votes
asked Aug 22, 2019 in Selenium by john ganales
...