4

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

enter image description here

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?

Marvin Pinto
  • 30,138
  • 7
  • 37
  • 54
Guru_1010
  • 574
  • 7
  • 22

1 Answers1

0

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.

Anders
  • 15,227
  • 5
  • 32
  • 42