Is there a way to utilize selenium webdriver
in order to retrieve all links from a page that contain the attribute a[href*=/simulation/form/]
, and proceed to open and close each one?
Although I attempted the code provided below, I encountered the error message
TypeError: link.click is not a function
var simLinks = driver.findElements(By.css('a[href*=/simulation/form/]'));
for(var link in simLinks){
link.click();
driver.wait(30000);
driver.back();
}
Running console.log(simLinks.length)
resulted in undefined
However, when attempting to open a single link of that type, it executes without issue:
var simLinks = driver.findElement(By.css('a[href*=/simulation/form/]')).click();