Hello all,
I am using watir (6.10.2).
GIVEN HTML :
<div class="Dashboard_Widget_Toolbar_Item" data-widgetapplicationid="Authentication.Application.431" data-widgetconfigure="What I Want">
Because I am using PageObject, I have been used to create page elements using custom attribute as so:
PAGEOBJECT ELEMENT DEF: Where I simply replace the iphen by an underscore ("-" => "_")
self.div(:my_widget, data_widgetconfigure: "What I Want")
Now you see me coming, when I wanted to validate the value of my attribute, I came across the below:
@browser.my_widget_element.attribute_value(:data_widgetconfigure).nil?
# => true
While the correct way seems to be:
@browser.my_widget_element.attribute_value("data-widgetconfigure").nil?
# => false
My question is to know as to why can't I use the first validation but more importantly why is it not erroring out?
Thanks
Jeff