I'm stuck and need help on investigation and improvement.
I am trying to gather all the <a>
tags with Annual Report as their partial text
then loop through them since they're originally located inside a table(2nd column per row
).
Below is the process that I'm planning to execute:
- After clicking an
<a>
tag, a new window wouldpop up
- find and get specific values in the new window
- close the window
- move to the next element (
<a>
tag) and repeat
The code below is my current progress, but it is completely not working. I am still unable to click the very first element.
var reportLinks = driver.findElements(By.partialLinkText('Annual Report'));
for(var i = 0; i < reportLinks.length; i++){
reportLinks[i].click();
}