In our web-aplication we use several alerts like this:

I need to retrieve link from this alert.
I did:
Alert alert = driver.switchTo().alert();
String link = alert.getText();
But alert.getText() returns “Link to copy” not a link in textfield
so how can I get link in this case?
WebDriver will be unable to retrieve the link text.
For Windows, you could leverage the Windows Automation API to scrape the text, other operating systems probably have similar APIs that you could utilize – but the short answer is that WebDriver won’t be able to do this.