[wtr-general] Re: How often to get element reference, best practice?

2018-09-11 Thread NaviHan
Hi Titus You said "when_present" and 'wait_until(&:present?)" does the same thing, which is Waits for element to be present, the former is deprecated and latter is recommended. Why is that if bot does the same thing Im trying to understand if "wait_until(&:present?)" is in any ways

Re: [wtr-general] Re: Watir [DEPRECATION] ["stale_present"] Checking `#present? == false`

2018-09-11 Thread Titus Fortner
Good news. I figured out how to minimize this message. Everything should be better in 6.14. :) On Tuesday, September 11, 2018 at 8:54:49 AM UTC-7, Titus Fortner wrote: > > The deprecation message is thrown when rescuing a stale exception during a > call for #exists? / #visible? #present?

[wtr-general] Re: How often to get element reference, best practice?

2018-09-11 Thread Titus Fortner
Oh man, that FAQ is kind of dated, and more confusing than I remember it being. I should tidy a couple things there. The specific use case detailed in "Why are my tests taking so long?" section of that FAQ is going to be rare, and very unlikely to apply to you. So you should just ignore that

Re: [wtr-general] Re: Watir [DEPRECATION] ["stale_present"] Checking `#present? == false`

2018-09-11 Thread Titus Fortner
The deprecation message is thrown when rescuing a stale exception during a call for #exists? / #visible? #present? because when we make the code changes below, tests that rely on this behavior will fail. They need to know about it, so there needs to be a message. Yes, the message is happening

[wtr-general] Re: How often to get element reference, best practice?

2018-09-11 Thread NaviHan
Sorry to too many replies. But this is really killing me. I see there is anothet wait which is wait_until_present? Someone please clarify the difference between the 3 1. element.when_present, which is deprecated and auto included from watir 6.0 onwards 2. element.wait_until(&:present) which is

[wtr-general] Re: How often to get element reference, best practice?

2018-09-11 Thread NaviHan
Hi Justin/Titus I have read the watit 6.0 release notes and FAQ @ http://watir.com/watir-6-faq/#H Thanks a lot for giving the valuable info. Until now I was under the impression that "element.when_present" & "element.wait_until(&:present)", but reading the notes I understood that they are

[wtr-general] Re: How often to get element reference, best practice?

2018-09-11 Thread NaviHan
Hi Justin Unfortunately thats not the truth. We started automation for our project approximately an year back, and Im pretty sure the version since the start is post 6.0. We are doing these kind of duplication out of ignorance. Coming to the question, does watir show any warnings if we use

[wtr-general] Re: How often to get element reference, best practice?

2018-09-11 Thread Justin Ko
In that example, you should just #add_to_bag. I'm guessing that you are working with a code base that is older than Watir 6.0. Before v6.0, add_to_bag_element.when_present.click was required for elements that were not immediately present on page load (ie you needed to wait for them to appear).

Re: [wtr-general] Re: Watir [DEPRECATION] ["stale_present"] Checking `#present? == false`

2018-09-11 Thread rajagopalanmadasami
> > element.wait_while(&:exists?) No, this wouldn't work, I have to wait until the element is visible, element becomes invisible when loading completes. And also, I am checking whether element is visible or not, I am checking whether previously located element exist in the DOM. So this line