[Wtr-general] custom attributes
Prema Arya
prema.arya at gmail.com
Tue Jan 30 05:54:27 EST 2007
I thought I should elaborate the two ways, you can access an element using
the custom attribute directly like this: puts ff.text_field(:custom,
"custom") and
Using xpath in Firefox.
And to access a custom attribute value is same as it is in Watir.
puts ff.text_field(:id, "id").attribute_value("custom")
For the above two puts output will be
Prema
custom
PS: missed the last output line in the previous mail.
Prema
On 1/30/07, Prema Arya <prema.arya at gmail.com> wrote:
>
> Yes we can do it in FireWatir also, there are two ways you can do:
>
> require 'firewatir'
> include FireWatir
>
> ff = Firefox.new(5)
>
> ff.goto("file:///F:/extras/firewatir/custom.html")
> puts ff.text_field(:custom, "custom").value
> puts ff.text_field(:id, "id").attribute_value("custom")
> ff.close
> html code
> --------------
> <html>
> <body>
> <form>
> <input id="id" value="Prema" custom="custom">
> </form>
> </body>
> </html>
> ouput is:
> ------------
> Prema
>
> On 1/29/07, Paul Rogers <paul.rogers at shaw.ca > wrote:
> >
> > I really only p[osted this for information to others who want to search
> > the archives. If its something that occurs a lot, it may be possible to add
> > it to watir directly, but Ive never seen these things used.
> >
> > And does firefox support them? Allow you to access them?
> >
> >
> > Paul
> >
> >
> > On 1/29/07, Prema Arya < prema.arya at gmail.com > wrote:
> > >
> > > ie.text_field(:xpath , "//input[@mytag='paul']/")
> > >
> > >
> >
> > This is so cool.
> > --
> > Zeljko Filipin
> > zeljkofilipin.com
> > _______________________________________________
> > Wtr-general mailing list
> > Wtr-general at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/wtr-general
> >
> > _______________________________________________
> > Wtr-general mailing list
> > Wtr-general at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/wtr-general
> >
> >
>
>
> --
> Prema Arya
--
Prema Arya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070130/3dff0beb/attachment.html
More information about the Wtr-general
mailing list