Getting text from a text field in alerts

In our web application we use several warnings:

enter image description here

I need to get a link from this warning. I did:

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

But alert.getText() returns a "Link to copy" and not a link in a text field, so how can I get a link in this case?

+4
source share
1 answer

WebDriver will not be able to get the link text. For Windows, you can use the Windows Automation API to clear text, other operating systems probably have similar APIs that you could use, but the short answer is that WebDriver will not be able to do this.

0
source

Source: https://habr.com/ru/post/1391415/


All Articles