Jeff Fagot
2018-06-08 21:48:14 UTC
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
--
--
Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
In short: search before you ask, be nice.
watir-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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
--
--
Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
In short: search before you ask, be nice.
watir-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.