[Wtr-general] custom attributes

Prema Arya prema.arya at gmail.com
Mon Jan 29 08:37:17 EST 2007


Paul, sorry, I misinterpreted your question, you can access the custom
attribute using the function attribute_value

inText = ie.text_field(:name ,"aa" )
puts inText.attribute_value("mytag")  => paul

Prema


On 1/29/07, Prema Arya <prema.arya at gmail.com> wrote:
>
> Hi Paul,
>
> You can use xpath to address the elements having custom attributes.
>
> For example, to access the following input tag
>
> <input type="text" name="aa" mytag="paul">
>
> using xpath the code would look like this:
>
> inText = ie.text_field(:xpath , "//input[@mytag='paul']/")
> puts inText
>
> Regards,
> Prema
>
> On 1/29/07, Paul Rogers <paul.rogers at shaw.ca > wrote:
>
> >
> >
> > Some one asked me off list if they could access the mytag part of some
> > html like the following
> >
> > <input type = text name = aa mytag=paul>
> >
> > With the 1.5.1-1145 gem you can do this:
> >
> > puts ie.text_field(:index,1).ole_object.mytag
> > returns 'paul'
> >
> >
> > this doesnt seem to work though:
> >
> > ie.text_field(:mytag ,/p/).flash
> > causes a MissingWayOfFindingObjectException
> >
> > Hope that helps others too.
> >
> > Paul
> >
> >
> >
> > _______________________________________________
> > 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/20070129/653a2958/attachment.html 


More information about the Wtr-general mailing list