I'm trying to see if when a link is clicked a report is generated on the page using Selenium WebDriver with Java.
What happens is there are a bunch of links on a page, most of them when clicked go to another page where I have automated filling in the details and submitting the form to check the report is generated.
However, there are three reports that when clicked cause some JS to run and after a few seconds, a new link is displayed on the same page to download the report.
How can I click this link?
I am reading all the links on the page into a list of WebElements then looping through them for where the href contains javascript: to void[0];
I then try calling the click method on that element in the list, allLinks.get(i).click();
This is the same thing I do for the other reports and it works fine but on these 3 I get an error "Element is not currently visible and so may not be interacted with"
Using firebug if I inspect the link that starts the JS running it says:
<a onclick="requestReportGeneration('2cad4d4e5c8855c47a88b6ddf8345735', 'reportDiv33','CSV')" href="javascript:void[0];">CSV</a>
Can anyone suggest a way to click the link?
The page contains lots of links that say CSV so I can't just use the link text.
UPDATE: I've just had a thought about this which might help. When I first come to the page with the report links it will say "Order reports" I need to click the heading which then calls a JS function to expand that section and display the links.
The reports that work because when I come to this page I just read all the hrefs of the page source and do driver.get(reportList.get(i); so I'm not actually clicking on the link.
I have added a link to get the xpath of the heading and click it but then when I try to click the link with the href or javascript: void I still get an error saying it's not visible.