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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED] > 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 < [EMAIL PROTECTED] > wrote:
> >
> > ie.text_field(:xpath , "//[EMAIL PROTECTED]'paul']/")
> >
> >
>
> This is so cool.
> --
> Zeljko Filipin
> zeljkofilipin.com
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
>
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
>
>


--
Prema Arya




--
Prema Arya
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to