in reply to Re^4: UNABLE TO CLICK ON SELENIUM ELEMENT
in thread UNABLE TO CLICK ON SELENIUM ELEMENT

Okay -- there are pastebin services, however, which might help.

My point about "this is surely not what you intended" is that the formatting is all wrong. Monkomatic, compare this:

#$sel->click("xpath=//imgcontains($addcardlink)");

with this:

#$sel->click("xpath=//img[contains($addcardlink)]");

See how part of the XPath query is transformed into a link in the first one? It's because you need to put <c></c> tags around every example you give; otherwise your code can get seriously messed up by the PerlMonks node formatter.

Have you tried something like $sel->click("xpath=//img[contains(@src, \"$addcardlink\")]");? You might be getting the syntax error because $addcardlink is expanding the URL in place, but it may need to be quoted.

Selenium's wiki has more information on using XPath queries to locate elements.

Anne