[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-10-02 Thread Justin Ko
Hi Navi, I would expect the closing situation to be much simpler. You should be able to just check that the element is no longer present: slide_dialog = browser.div(id: 'slide-dialog-container') slide_dialog.wait_while(&:present?) The overflow was only important in the expanding case as it

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-10-02 Thread NaviHan
Hi Justin This works fine and I have ran the script multiple times and it passed. This is configured to run on Jenkins Boxes. Waiting for overnight results. As a related question. We use the below code for the pop up to load completely. I have a verification to be done after the pop up has

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-26 Thread Justin Ko
Navi, In the video of the problem, you can actually see the overflow style change while the section is sliding. You can also see it change using the following Watir code: browser.link(text: 'Sign in here').click slide_dialog = browser.div(id: 'slide-dialog-container') 150.times { puts

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-26 Thread NaviHan
Hi Justin/Titus Trying to understand the overflow attribute in style sheet When the pop up is not present the oveflow property is there unser style as shown here https://i.imgur.com/X1MxiHD.png When the popup is fully loaded its the same. https://i.imgur.com/xu5E3mp.png So what does this

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-25 Thread Justin Ko
Trying this on a faster machine and against some other pages, I'm noticed flaws in my previous testing. Some of the properties, ex Element#height, start as if the sliding container was visible. When the animation starts, they get reset. For example, I saw the height go from 346, down to 1 and

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-25 Thread Justin Ko
Element#height didn't work for me. It was returning height of the div including the part cut-off by the overflow. The clientHeight gave the height excluding the cut-off portion. Justin On Tuesday, September 25, 2018 at 2:33:06 PM UTC-4, Titus Fortner wrote: > > Also, Watir has a

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-25 Thread Titus Fortner
Also, Watir has a `Element#height` method, so you shouldn't need to resort to JS to get that value. On Tuesday, September 25, 2018 at 11:31:32 AM UTC-7, Titus Fortner wrote: > > Yeah, it's clicking, but I suspect JS event isn't ready to act yet. > > Note the style transition attributes there.

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-25 Thread Titus Fortner
Yeah, it's clicking, but I suspect JS event isn't ready to act yet. Note the style transition attributes there. Try waiting for the element style to not include "overflow" after the element becomes present. You can also try waiting for the size of the slide dialog container to equal some

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-25 Thread Justin Ko
It looks like the button itself isn't sliding. The div that contains it is actually increasing in height. So my previous suggestions about waiting for the button to stop moving doesn't work. I'm still not quite clear on how the click is getting intercepted. However, waiting for the section

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-25 Thread NaviHan
Hi Titus & Justin My theory of actually clicking the button before the pop is fully loaded could be wrong, because even if its not fully loaded the click on "continue as guest" should dismiss the popup. Please see the video here

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-25 Thread Titus Fortner
> 3. The click is sent to the coordinates, which since the button has since moved, will not click the button If this happened, there should be a stale element exception, which Watir would continue to relocate until it worked, which is why I suspect it is JS element/action binding related,

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-25 Thread Justin Ko
(Sorry, if some of this repeats Titus's response. I was half way through this when he replied.) If I'm envisioning the sliding correctly, I believe what happens is: 1. The button starts sliding on to the page (at which point it'll be considered present) 2. The coordinates of the button are

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-25 Thread Titus Fortner
This kind of dynamic code is difficult. Firstly, `wait_until(&:present?).click` is currently redundant. The wait will happen automatically if you just do: `click` Essentially the driver is processing the element as displayed before the desired action is attached to that element. Ideally, the