I want to capture the text that is produced after clicking one of the links. But instead what i end up doing is capturing the text of the link.
Snippet of the code I am using:
driver.navigate().to("https://demoqa.com/links");
driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[2]/div[2]/p[3]/a")).click();
System.out.println(driver.findElement(By.xpath("//*[@id=\'linkResponse\']")).getText());
I have been trying to use getText()
. But i don't know how to get text generated from the link.
Snapshot of the page: