Just to be clear I am using SpookyJS which is a library that allows for a headless CasperJS.
I am able to click and select other XPaths just fine on all other pages,the problem is only on a particular page, the page loads perfectly but all of the XPaths return this error.
Cannot dispatch mousedown event on nonexistent selector
I have a screenshot taken before the function attempts to click the xPath and the screenshot shows that the page is loaded perfectly.
if I trying using the waitForSelector
function I get the timeout error, I've tried different XPaths on different pages and none of them work.
Here is my code in CoffeeScript don't mind the spooky.then
just think of it as casper.then
:
// 3 steps occur before this and they work perfectly
spooky.then([{x:selectXPath}, () ->
@wait(3000, () ->
eval(x) // This loads the xPath function
@capture('server/components/spooky/img.png')
@click(xPath('//*[@id="wp-page-header-middle"]/table/tbody/tr/td[1]/a'))
)
])
The table I'm interested in is inside of an iframe.