You can usually use whatever attribute is already valid in html. "name" for 
tables, as far as i know, is not a valid attribute for example.

You can get a rough estimation of the available attributes at w3 site[1]. 
For example, if you look at the table element[2], then it supports "border" 
and "global attributes". When you look at the global attributes[3], then 
"name" is not listed there.

There might be of course differences between html4 and html5. In short - if 
you're using some attribute in your html markup and it is a valid attribute 
for that element, then just trying it out in watir should work. If it does 
not, then feel free to open up an issue in watir-classic[4] or 
watir-webdriver[5] repository respectably.

Jarmo Pertman
-----
IT does really matter - http://itreallymatters.net

[1] http://www.w3.org/TR/html-markup/elements.html
[2] http://www.w3.org/TR/html-markup/table.html#table
[3] http://www.w3.org/TR/html-markup/global-attributes.html
[4] https://github.com/watir/watir-classic/issues
[5] https://github.com/watir/watir-webdriver/issues

On Saturday, March 2, 2013 3:03:11 AM UTC+2, Justin Ko wrote:
>
> As far as I can tell, the code checks against the "attribute_list" to 
> determine if the attribute is valid. You can see the list for a specific 
> element type by doing:
>
> browser.element.class.attribute_list
>
> where "element" can be any element type (text_field, link, div, etc.). I 
> believe it is auto-generated some how.
>
> Justin Ko
>
>
>
> On Friday, March 1, 2013 1:04:25 PM UTC-5, Chuck van der Linden wrote:
>>
>> We used to have a big chart, which listed all the elements, and what 
>> could be used to identify them, but it was hard to keep up to date, and I'm 
>> not sure it's around, linked, or up to date if it is.  
>>
>> Is there a simple way (perhaps it has escaped me) to know (perhaps via 
>> the rubydocs) what things can be used to select an element?
>>
>> for example 
>>  browser.text_field(:name => "foo")  #valid
>>  browser.tables(:name => "foo")  # results in: invalid attribute: :name 
>> (Watir::Exception::MissingWayOfFindingObjectException)
>>
>> If I look up the tables method in the rubydoc, all I see is  tables 
>> (*args)   how can I tell what a valid arg is?
>>
>>
>>

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
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 watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to