What Tim wanted probably to say was that starting from Watir 3, data
attributes are supported.

If you can't upgrade for whatever reason then the code adding support is
located in Element#method_missing at
https://github.com/watir/watir-classic/blob/master/lib/watir-classic/element.rb#L428-429


Jarmo

On Fri, Aug 10, 2012 at 9:17 AM, Tim Koopmans <t...@altentee.com> wrote:

> support for html5 data-* attributes by using :data_* for locating and #data_*
> for retrieving attribute values
>
> Regards,
>
> Tim Koopmans
> +61 417 262 008
>
> <http://altentee.com/>
>
> The Automation Company
>
>
>
>
> On Fri, Aug 10, 2012 at 6:25 AM, Abe Heward <ahew...@rsmart.com> wrote:
>
>> If I want to monkey patch Watir to recognize custom HTML attributes
>> ("custom_attrib" in the example code) I just add this code:
>>
>> module Watir
>>
>>  class Element
>>
>>    def custom_attrib
>>
>>      @how = :ole_object
>>
>>      return @o.custom_attrib
>>
>>    end
>>
>>  end
>>
>> end
>>
>> However, take a look at the custom attributes on this div element:
>>
>>
>> <div class="contentauthoring_cell_element" data-element-id="id6775571" 
>> data-element-type="contacts">
>>
>> Notice that those custom items contain dashes.  This is bad, because Ruby
>> does not allow dashes to exist in its method names.
>>
>> So, is Watir simply unable to be monkey-patched for these sorts of custom
>> attributes? If so, that would be really unfortunate because it seems like a
>> pretty common thing to have in HTML nowadays.
>>
>> OTOH, if it can be monkey-patched to support these things, then how?
>>
>> _______________________________________________
>> Wtr-development mailing list
>> Wtr-development@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/wtr-development
>>
>
>
> _______________________________________________
> Wtr-development mailing list
> Wtr-development@rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-development
>
_______________________________________________
Wtr-development mailing list
Wtr-development@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to