Re: [wtr-general] Xpath as a selector in hash format. Am I doing it wrong?

2019-03-27 Thread Titus Fortner
:xpath as key is "locate an element with provided xpath value" "xpath" as key is "locate an element with an attribute of 'xpath' that has the provided value" The goal of Watir, in general, though, is to make it so you should never need to use XPath. On Wed, Mar 27, 2019 at 11:24 AM Steve Parrado

[wtr-general] Xpath as a selector in hash format. Am I doing it wrong?

2019-03-27 Thread Steve Parrado
So while tooling around on some stuff, I was trying different ways to use selectors in conjunction with some array values. I came across something that I can't quite figure out. I recreated it using http://automationpractice.com/index.php to be able to ask in general without need for people

[wtr-general] Re: How to check if a collection is present in PageObject?

2019-03-27 Thread Justin Ko
If there are no matching elements, you should get an empty Array: p page.products_on_wishlist_elements.class #=> Array p page.products_on_wishlist_elements #=> [] Justin On Wednesday, March 27, 2019 at 8:18:45 AM UTC-4, NaviHan wrote: > > Hi Titus > > I read a wondeful article about the

[wtr-general] Re: How to check if a collection is present in PageObject?

2019-03-27 Thread NaviHan
Hi Titus I read a wondeful article about the enumerable methods, Any, All, None & One. https://www.rubyguides.com/2018/10/any-all-none-one/ For the particular example in the first post, I used the below code to just return if wishlist is empty(No buttons are present on the wishlist page) and