Problems? Is your data what you think it is? | |
PerlMonks |
Re^5: UNABLE TO CLICK ON SELENIUM ELEMENTby anneli (Pilgrim) |
on Oct 18, 2011 at 21:06 UTC ( [id://932246]=note: print w/replies, xml ) | Need Help?? |
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:
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
In Section
Seekers of Perl Wisdom
|
|