Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^5: UNABLE TO CLICK ON SELENIUM ELEMENT

by anneli (Pilgrim)
on Oct 18, 2011 at 21:06 UTC ( [id://932246]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://932246]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-04-26 09:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found