On Friday, November 28, 2014 6:29:50 AM UTC-8, mc060200778 wrote:
>
> Well, i got solution using following line of code.
> browser.link(:text => "*Mobile & Accessories*").click
>
> Just wanted to ask, is it the only way or could be some other nice way?
> Thanks
>

I'm not sure this is the reason, but in HTML a span is not generally 
considered a clickable element. A span is really intended to be little more 
than a placeholder so you can decorate some text with CSS.

By attaching the click event to the link that contains the span, you are 
doing it correctly. But you don't have to use the text attribute of the 
link. You could also do it via some other attribute like href:

browser.link(:href => "/home").click

... if, that is, this is the only link in the page with that href.

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to