>
> 1. Just like we do plural for div, I mean divs, isnt there plural version 
> for select_list i:e select_lists? Similarly buttons?
>     How do we know if there is a plural version at all. I couldn't find 
> the documentation.
>

The plural version `#select_lists` does exist. I don't think there is any 
up-to-date documentation for the list of accessors, but I believe the 
plural version is always defined. You can see what is defined in the 
Accessors module - `#select_lists` is dynamically defined at the end of the 
module 
(https://github.com/cheezy/page-object/blob/master/lib/page-object/accessors.rb#L1162-L1172).
 

> 2. If two elements have the same attribute, for example say there are 
> multiple divs and multiple select lists with class name starting with 
> "dwfrm_cart_shipments" 
> and if we define the object as below
>   
> elements(:product_line_items_in_bag, :name => /^dwfrm_cart_shipments/)
>
> Does this identify both the divs and the select_lists.
> And later we pass this to a block and filter the specific element by a 
> specific attribute. (Like you identified the select_list with attribute "
> data_product_id"
>

Yes, `#elements` will include all tag types - ie you'll have a collection 
of divs and selects. If you know you only want a specific tag, you should 
use that respective method. 
 

> 3. With the attribute "data_product_id", is there a reason you have used 
> underscore(_) instead of hyphens (-)
>

Hyphens are not valid characters in method and symbol names. As a result, 
Watir chose to use underscores. Watir will switch all of the underscores to 
hypens when looking up the attribute value.
 

> 4. Could you please explain the use of "map(&:text)" called on elements?
>

`elements.map(&:text)` will return an Array containing the text of each 
element. It's equivalent to:
texts = []
elements.each { |e| texts << e.text }

Justin

>

-- 
-- 
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-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/d/optout.

Reply via email to