generally i feel span doesnot support text refer to supported methods by
element in watir wiki
but confirm with others
anyways try this
browser.span(:text, /.*butterfly/).click

ravi


On Thu, Nov 19, 2009 at 2:57 PM, Tiffany Fodor <tcfo...@comcast.net> wrote:

>
> Hi!
>
> Since you're already using a regex, could you do this:
>
> browser.span(:text, /butterfly/).click
>
> or do you have multiple spans with 'butterfly' in the text?  If so,
> could you specify the one you want using it's index?
>
> browser.span(:text => /butterfly/, :index => 3).click
>
> Also, it might help to determine if this issue is limited to
> safariwatir or if it happens in other flavors of watir as well.  Have
> you tried the command on an IE or Firefox browser in irb?
>
> Hope this helps!
>
> -Tiffany
>
>
> On Nov 19, 9:03 am, Ethan <notet...@gmail.com> wrote:
> > The (?-mix stuff is just the string representation of the regexp - you
> can
> > see this on any regexp doing #to_s:>> /foo/.to_s
> >
> > => "(?-mix:foo)"
> > But, I don't have anything more useful to add; I don't really know
> anything
> > about safariwatir - sorry.
> >
> > On Thu, Nov 19, 2009 at 10:59, QAguy <qablogm...@gmail.com> wrote:
> >
> > > Unfortunately that didn't work either. I did this:
> >
> > > browser.span(:text, /butterfly\.m4v/).click and got this:
> >
> > > Unable to locate Span element with text of (?-mix:butterfly\.m4v)
> >
> > > I'm not sure what the ?-mix: part of that is. Anything else you can
> > > recommend?
> >
> > > QAguy
> >
> > > On Nov 19, 3:52 am, John Kolokotronis <johnj...@gmail.com> wrote:
> > > > The dot character in a regex (.) is a wildcard so you need to escape
> > > > it. Try this:
> >
> > > > browser.span(:text, /butterfly\.m4v/).click
> >
> > > > Regards,
> >
> > > > John
> >
> > > > On Nov 18, 3:35 pm, QAguy <qablogm...@gmail.com> wrote:
> >
> > > > > I cannot add an id as I don't have control over code decisions
> > > > > unfortunately. So I am forced to work with what I have.
> >
> > > > > I also tried this: browser.span(:text, /butterfly.m4v/).click which
> > > > > gives me this:
> >
> > > > > Unable to locate Span element with text of (?-mix:butterfly.m4v)
> >
> > > > > and this: browser.span(:title, /butterfly.m4v/).click which gives
> me
> > > > > this:
> >
> > > > > SafariWatir does not currently support finding by title
> >
> > > > > So I'm kinda stumped at the moment as to what to do.
> >
> > > > > Thanks
> > > > > QAguy
> >
> > > > > On Nov 17, 9:16 pm, Adam Esterline <a...@esterlines.com> wrote:
> >
> > > > > > Hmm... I am not sure why it cannot find the span.
> >
> > > > > > Does it seem to only be a problem when finding by text?    Can
> you
> > > add
> > > > > > an id to that span?    Does it work when searching for it by id?
> >
> > > > > > Looking for a little more information.
> >
> > > > > > AE
> >
> > > > > > On Tue, Nov 17, 2009 at 3:57 PM, QAguy <qablogm...@gmail.com>
> wrote:
> >
> > > > > > > I am using the following:
> >
> > > > > > > browser.span(:text,'butterfly.m4v').click
> >
> > > > > > > to click on that item in the following code:
> >
> > > > > > > <span class="name">
> > > > > > > <a title="butterfly.m4v" class="trim_to_height 1_lines"
> > > href="/videos/
> > > > > > > 359dd3be1914b8"><span>butterfly.m4v</span></a>
> > > > > > > </span>
> >
> > > > > > > But I get the following result:
> >
> > > > > > > Unable to locate Span element with text of butterfly.m4v
> >
> > > > > > > This is being run from a file using rpsec with safariwatir. No
> sure
> > > > > > > why this is not working. Hoping someone can help.
> >
> > > > > > > Thanks
> > > > > > > QAguy
> >
> > > > > > --
> > > > > > Adam Esterlinehttp://adamesterline.com/
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to