Re: [wtr-general] Same problem

2018-11-06 Thread rajagopalan madasami
Hi Titus, waiting for this fix. Thanks!

On Wed 7 Nov, 2018, 2:29 AM  Hi Titus,
>
> I face the same problem again in another place. I created a gist for this.
> Can you please confirm this whether it's a same issue and your fix would
> resolve this problem ?
>
> https://gist.github.com/Rajagopalan-M/47a9381bf82ca2468539a5bc1189ba40
>
> --
> --
> 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.
>

-- 
-- 
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.


[wtr-general] Same problem

2018-11-06 Thread rajagopalanmadasami
Hi Titus,

I face the same problem again in another place. I created a gist for this. 
Can you please confirm this whether it's a same issue and your fix would 
resolve this problem ?

https://gist.github.com/Rajagopalan-M/47a9381bf82ca2468539a5bc1189ba40

-- 
-- 
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.


Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
Hi titus,

It arrives at some other places as well. I think fixing in Core would
resolve the problem. I am expecting a release which solves this problem. I
have raised but in github which you might have seen it.


On Wed, 7 Nov 2018 at 00:03, Titus Fortner  wrote:

> This is the alert click here:
>
> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de#file-gistfile1-txt-L2732
>
>
> On Tuesday, November 6, 2018 at 12:20:07 PM UTC-6, rajagopalan madasami
> wrote:
>>
>> I am not clicking any alert before the button. And also Let me check your
>> solution first and if it works fine then I raise the defect. So now I need
>> to wait for spinner to disappear before and after the click. Okay.
>>
>> On Tue 6 Nov, 2018, 11:46 PM Titus Fortner >
>>> I posted it above:
>>> @b.alert.ok
>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>> @b.button(id: "NavContinue").click
>>>
>>> But we can make this better in the Watir code which is why I asked if
>>> you could also raise the issue on Github.
>>>
>>>
>>>
>>> On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami
>>> wrote:

 Okay. Can you please tell me what order should I need to write the
 code?

 And I have a question, If element goes stale then WATIR automatically
 regains the element , right ? It regain in many places which I see.

 On Tue 6 Nov, 2018, 11:39 PM Titus Fortner >>>
> It's failing because it goes stale. It goes stale because there is a
> refresh on the page, the refresh on the page happens after the spinner 
> that
> the alert kicks off. The problem is that the element is located before the
> spinner, and for it to work right now, you have to wait until after the
> spinner to locate the element. However you organize it in the code, it
> needs to be in that order not the order you have.
>
>
>
> On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan
> madasami wrote:
>>
>> I am calling this function
>>
>> def waitForPageLoad
>>
>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>> (jQuery.active === 0)").eql? true}
>> end
>>
>> function in every click function like
>>
>> def clickButton(locator, action, name, data)
>>   puts "ClickButton   : #{name}"
>>   loc = getLocator(locator)
>>   @b.button(loc.first => loc.last).click
>>   waitForPageLoad
>> end
>>
>> Do you see the clickButton method
>>
>> calls waitForPageLoad at the end so it waits for the spinner disappear. 
>> So it doesn't click on the spinner. Even if it clicks at the
>>
>> spinner it retry it because I have included 
>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>
>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>   raise_present unless Wait.timer.remaining_time.positive?
>>   raise_present unless %i[wait_for_present wait_for_enabled 
>> wait_for_writable].include?(precondition)
>>   retry
>>
>> So all I am seeing here is, It perfectlys lands on a page, and it 
>> successfully enters into the click method but it waits for 30 seconds 
>> and it fails.
>>
>>
>>
>>
>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner 
>> wrote:
>>
>>> Yes, this makes sense from the code perspective.
>>>
>>> What your site is doing is requiring you to accept an alert, then it
>>> does some kind of processing, then it refreshes some/all of the page.
>>>
>>> Your code is trying to click the element before the refresh has
>>> happened, and because of the way you are rescuing it, it is giving
>>> you
>>> misleading information. The element was located but couldn't be used,
>>> then at the point it is trying to be used it is stale, and that
>>> method
>>> isn't relocating when stale.
>>>
>>> Can you raise an issue on Github with this gist? Something like
>>> "Watir
>>> should relocate stale elements when trying to click them"
>>>
>>> In the meantime, something like this should work:
>>>
>>> @b.alert.ok
>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>> @b.button(id: "NavContinue").click
>>>
>>>
>>> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
>>> >
>>> > Hi Titus,
>>> >
>>> > Here is the gist url
>>> >
>>> >
>>> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>>> >
>>> > --
>>> > --
>>> > 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
>>> > 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
Actually my problem is simple, I forgot to call waitForPageLoad after
acceptPopUp. That's the reason i faced this error. I called
waitForPageLoad after every click but forgot to call after acceptpopUp. Now
It works fine.

On Wed, 7 Nov 2018 at 00:05, Titus Fortner  wrote:

> I'm not sure what needs to happen after the click since that's where it is
> failing. But this code can't hurt because if there is no spinner it will
> move on to the next thing right away
>
>
> On Tuesday, November 6, 2018 at 12:27:08 PM UTC-6, rajagopalan madasami
> wrote:
>>
>> Hi Titus,
>>
>> Can you please let me know whether my code is okay now?
>>
>>
>> def waitAndClickButton(locator, action, name, data)
>>   puts "ClickButton   : #{name}"
>>   sleep 2
>>   loc = getLocator(locator)
>>   @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>   @b.button(loc.first => loc.last).click
>>   @b.div(id: "spinnerOverlay").wait_while(&:present?)
>> end
>>
>>
>> On Tue, 6 Nov 2018 at 23:46, Titus Fortner  wrote:
>>
>>> I posted it above:
>>> @b.alert.ok
>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>> @b.button(id: "NavContinue").click
>>>
>>> But we can make this better in the Watir code which is why I asked if
>>> you could also raise the issue on Github.
>>>
>>>
>>>
>>> On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami
>>> wrote:

 Okay. Can you please tell me what order should I need to write the
 code?

 And I have a question, If element goes stale then WATIR automatically
 regains the element , right ? It regain in many places which I see.

 On Tue 6 Nov, 2018, 11:39 PM Titus Fortner >>>
> It's failing because it goes stale. It goes stale because there is a
> refresh on the page, the refresh on the page happens after the spinner 
> that
> the alert kicks off. The problem is that the element is located before the
> spinner, and for it to work right now, you have to wait until after the
> spinner to locate the element. However you organize it in the code, it
> needs to be in that order not the order you have.
>
>
>
> On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan
> madasami wrote:
>>
>> I am calling this function
>>
>> def waitForPageLoad
>>
>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>> (jQuery.active === 0)").eql? true}
>> end
>>
>> function in every click function like
>>
>> def clickButton(locator, action, name, data)
>>   puts "ClickButton   : #{name}"
>>   loc = getLocator(locator)
>>   @b.button(loc.first => loc.last).click
>>   waitForPageLoad
>> end
>>
>> Do you see the clickButton method
>>
>> calls waitForPageLoad at the end so it waits for the spinner disappear. 
>> So it doesn't click on the spinner. Even if it clicks at the
>>
>> spinner it retry it because I have included 
>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>
>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>   raise_present unless Wait.timer.remaining_time.positive?
>>   raise_present unless %i[wait_for_present wait_for_enabled 
>> wait_for_writable].include?(precondition)
>>   retry
>>
>> So all I am seeing here is, It perfectlys lands on a page, and it 
>> successfully enters into the click method but it waits for 30 seconds 
>> and it fails.
>>
>>
>>
>>
>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner 
>> wrote:
>>
>>> Yes, this makes sense from the code perspective.
>>>
>>> What your site is doing is requiring you to accept an alert, then it
>>> does some kind of processing, then it refreshes some/all of the page.
>>>
>>> Your code is trying to click the element before the refresh has
>>> happened, and because of the way you are rescuing it, it is giving
>>> you
>>> misleading information. The element was located but couldn't be used,
>>> then at the point it is trying to be used it is stale, and that
>>> method
>>> isn't relocating when stale.
>>>
>>> Can you raise an issue on Github with this gist? Something like
>>> "Watir
>>> should relocate stale elements when trying to click them"
>>>
>>> In the meantime, something like this should work:
>>>
>>> @b.alert.ok
>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>> @b.button(id: "NavContinue").click
>>>
>>>
>>> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
>>> >
>>> > Hi Titus,
>>> >
>>> > Here is the gist url
>>> >
>>> >
>>> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>>> >
>>> > --
>>> > --
>>> > Before posting, please read
>>> 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
I am sorry, yes, there is an alert.

On Wed, 7 Nov 2018 at 00:03, Titus Fortner  wrote:

> This is the alert click here:
>
> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de#file-gistfile1-txt-L2732
>
>
> On Tuesday, November 6, 2018 at 12:20:07 PM UTC-6, rajagopalan madasami
> wrote:
>>
>> I am not clicking any alert before the button. And also Let me check your
>> solution first and if it works fine then I raise the defect. So now I need
>> to wait for spinner to disappear before and after the click. Okay.
>>
>> On Tue 6 Nov, 2018, 11:46 PM Titus Fortner >
>>> I posted it above:
>>> @b.alert.ok
>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>> @b.button(id: "NavContinue").click
>>>
>>> But we can make this better in the Watir code which is why I asked if
>>> you could also raise the issue on Github.
>>>
>>>
>>>
>>> On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami
>>> wrote:

 Okay. Can you please tell me what order should I need to write the
 code?

 And I have a question, If element goes stale then WATIR automatically
 regains the element , right ? It regain in many places which I see.

 On Tue 6 Nov, 2018, 11:39 PM Titus Fortner >>>
> It's failing because it goes stale. It goes stale because there is a
> refresh on the page, the refresh on the page happens after the spinner 
> that
> the alert kicks off. The problem is that the element is located before the
> spinner, and for it to work right now, you have to wait until after the
> spinner to locate the element. However you organize it in the code, it
> needs to be in that order not the order you have.
>
>
>
> On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan
> madasami wrote:
>>
>> I am calling this function
>>
>> def waitForPageLoad
>>
>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>> (jQuery.active === 0)").eql? true}
>> end
>>
>> function in every click function like
>>
>> def clickButton(locator, action, name, data)
>>   puts "ClickButton   : #{name}"
>>   loc = getLocator(locator)
>>   @b.button(loc.first => loc.last).click
>>   waitForPageLoad
>> end
>>
>> Do you see the clickButton method
>>
>> calls waitForPageLoad at the end so it waits for the spinner disappear. 
>> So it doesn't click on the spinner. Even if it clicks at the
>>
>> spinner it retry it because I have included 
>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>
>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>   raise_present unless Wait.timer.remaining_time.positive?
>>   raise_present unless %i[wait_for_present wait_for_enabled 
>> wait_for_writable].include?(precondition)
>>   retry
>>
>> So all I am seeing here is, It perfectlys lands on a page, and it 
>> successfully enters into the click method but it waits for 30 seconds 
>> and it fails.
>>
>>
>>
>>
>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner 
>> wrote:
>>
>>> Yes, this makes sense from the code perspective.
>>>
>>> What your site is doing is requiring you to accept an alert, then it
>>> does some kind of processing, then it refreshes some/all of the page.
>>>
>>> Your code is trying to click the element before the refresh has
>>> happened, and because of the way you are rescuing it, it is giving
>>> you
>>> misleading information. The element was located but couldn't be used,
>>> then at the point it is trying to be used it is stale, and that
>>> method
>>> isn't relocating when stale.
>>>
>>> Can you raise an issue on Github with this gist? Something like
>>> "Watir
>>> should relocate stale elements when trying to click them"
>>>
>>> In the meantime, something like this should work:
>>>
>>> @b.alert.ok
>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>> @b.button(id: "NavContinue").click
>>>
>>>
>>> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
>>> >
>>> > Hi Titus,
>>> >
>>> > Here is the gist url
>>> >
>>> >
>>> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>>> >
>>> > --
>>> > --
>>> > 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-genera...@googlegroups.com
>>> > ---
>>> > You received this message because you are subscribed to the Google
>>> Groups "Watir General" group.
>>> > To 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
Titus,

Your solution perfectly works. Thanks. I have raised the defect in github

https://github.com/watir/watir/issues/814

When can I expect a fix for this? because I am developing a framework in
watir for a new application now.

On Wed, 7 Nov 2018 at 00:05, Titus Fortner  wrote:

> I'm not sure what needs to happen after the click since that's where it is
> failing. But this code can't hurt because if there is no spinner it will
> move on to the next thing right away
>
>
> On Tuesday, November 6, 2018 at 12:27:08 PM UTC-6, rajagopalan madasami
> wrote:
>>
>> Hi Titus,
>>
>> Can you please let me know whether my code is okay now?
>>
>>
>> def waitAndClickButton(locator, action, name, data)
>>   puts "ClickButton   : #{name}"
>>   sleep 2
>>   loc = getLocator(locator)
>>   @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>   @b.button(loc.first => loc.last).click
>>   @b.div(id: "spinnerOverlay").wait_while(&:present?)
>> end
>>
>>
>> On Tue, 6 Nov 2018 at 23:46, Titus Fortner  wrote:
>>
>>> I posted it above:
>>> @b.alert.ok
>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>> @b.button(id: "NavContinue").click
>>>
>>> But we can make this better in the Watir code which is why I asked if
>>> you could also raise the issue on Github.
>>>
>>>
>>>
>>> On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami
>>> wrote:

 Okay. Can you please tell me what order should I need to write the
 code?

 And I have a question, If element goes stale then WATIR automatically
 regains the element , right ? It regain in many places which I see.

 On Tue 6 Nov, 2018, 11:39 PM Titus Fortner >>>
> It's failing because it goes stale. It goes stale because there is a
> refresh on the page, the refresh on the page happens after the spinner 
> that
> the alert kicks off. The problem is that the element is located before the
> spinner, and for it to work right now, you have to wait until after the
> spinner to locate the element. However you organize it in the code, it
> needs to be in that order not the order you have.
>
>
>
> On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan
> madasami wrote:
>>
>> I am calling this function
>>
>> def waitForPageLoad
>>
>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>> (jQuery.active === 0)").eql? true}
>> end
>>
>> function in every click function like
>>
>> def clickButton(locator, action, name, data)
>>   puts "ClickButton   : #{name}"
>>   loc = getLocator(locator)
>>   @b.button(loc.first => loc.last).click
>>   waitForPageLoad
>> end
>>
>> Do you see the clickButton method
>>
>> calls waitForPageLoad at the end so it waits for the spinner disappear. 
>> So it doesn't click on the spinner. Even if it clicks at the
>>
>> spinner it retry it because I have included 
>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>
>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>   raise_present unless Wait.timer.remaining_time.positive?
>>   raise_present unless %i[wait_for_present wait_for_enabled 
>> wait_for_writable].include?(precondition)
>>   retry
>>
>> So all I am seeing here is, It perfectlys lands on a page, and it 
>> successfully enters into the click method but it waits for 30 seconds 
>> and it fails.
>>
>>
>>
>>
>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner 
>> wrote:
>>
>>> Yes, this makes sense from the code perspective.
>>>
>>> What your site is doing is requiring you to accept an alert, then it
>>> does some kind of processing, then it refreshes some/all of the page.
>>>
>>> Your code is trying to click the element before the refresh has
>>> happened, and because of the way you are rescuing it, it is giving
>>> you
>>> misleading information. The element was located but couldn't be used,
>>> then at the point it is trying to be used it is stale, and that
>>> method
>>> isn't relocating when stale.
>>>
>>> Can you raise an issue on Github with this gist? Something like
>>> "Watir
>>> should relocate stale elements when trying to click them"
>>>
>>> In the meantime, something like this should work:
>>>
>>> @b.alert.ok
>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>> @b.button(id: "NavContinue").click
>>>
>>>
>>> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
>>> >
>>> > Hi Titus,
>>> >
>>> > Here is the gist url
>>> >
>>> >
>>> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>>> >
>>> > --
>>> > --
>>> > Before posting, please read
>>> 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
After the click, spinner appears and it rotates few seconds and then it
disappears. That's why I have added after the click.

And you are right with your assumption your code runs fine without any
problem couple of times now. I will run 3 more time again and let me see
whether it persist. And I raise the bug in github.

On Wed 7 Nov, 2018, 12:05 AM Titus Fortner  I'm not sure what needs to happen after the click since that's where it is
> failing. But this code can't hurt because if there is no spinner it will
> move on to the next thing right away
>
>
> On Tuesday, November 6, 2018 at 12:27:08 PM UTC-6, rajagopalan madasami
> wrote:
>>
>> Hi Titus,
>>
>> Can you please let me know whether my code is okay now?
>>
>>
>> def waitAndClickButton(locator, action, name, data)
>>   puts "ClickButton   : #{name}"
>>   sleep 2
>>   loc = getLocator(locator)
>>   @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>   @b.button(loc.first => loc.last).click
>>   @b.div(id: "spinnerOverlay").wait_while(&:present?)
>> end
>>
>>
>> On Tue, 6 Nov 2018 at 23:46, Titus Fortner  wrote:
>>
>>> I posted it above:
>>> @b.alert.ok
>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>> @b.button(id: "NavContinue").click
>>>
>>> But we can make this better in the Watir code which is why I asked if
>>> you could also raise the issue on Github.
>>>
>>>
>>>
>>> On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami
>>> wrote:

 Okay. Can you please tell me what order should I need to write the
 code?

 And I have a question, If element goes stale then WATIR automatically
 regains the element , right ? It regain in many places which I see.

 On Tue 6 Nov, 2018, 11:39 PM Titus Fortner >>>
> It's failing because it goes stale. It goes stale because there is a
> refresh on the page, the refresh on the page happens after the spinner 
> that
> the alert kicks off. The problem is that the element is located before the
> spinner, and for it to work right now, you have to wait until after the
> spinner to locate the element. However you organize it in the code, it
> needs to be in that order not the order you have.
>
>
>
> On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan
> madasami wrote:
>>
>> I am calling this function
>>
>> def waitForPageLoad
>>
>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>> (jQuery.active === 0)").eql? true}
>> end
>>
>> function in every click function like
>>
>> def clickButton(locator, action, name, data)
>>   puts "ClickButton   : #{name}"
>>   loc = getLocator(locator)
>>   @b.button(loc.first => loc.last).click
>>   waitForPageLoad
>> end
>>
>> Do you see the clickButton method
>>
>> calls waitForPageLoad at the end so it waits for the spinner disappear. 
>> So it doesn't click on the spinner. Even if it clicks at the
>>
>> spinner it retry it because I have included 
>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>
>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>   raise_present unless Wait.timer.remaining_time.positive?
>>   raise_present unless %i[wait_for_present wait_for_enabled 
>> wait_for_writable].include?(precondition)
>>   retry
>>
>> So all I am seeing here is, It perfectlys lands on a page, and it 
>> successfully enters into the click method but it waits for 30 seconds 
>> and it fails.
>>
>>
>>
>>
>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner 
>> wrote:
>>
>>> Yes, this makes sense from the code perspective.
>>>
>>> What your site is doing is requiring you to accept an alert, then it
>>> does some kind of processing, then it refreshes some/all of the page.
>>>
>>> Your code is trying to click the element before the refresh has
>>> happened, and because of the way you are rescuing it, it is giving
>>> you
>>> misleading information. The element was located but couldn't be used,
>>> then at the point it is trying to be used it is stale, and that
>>> method
>>> isn't relocating when stale.
>>>
>>> Can you raise an issue on Github with this gist? Something like
>>> "Watir
>>> should relocate stale elements when trying to click them"
>>>
>>> In the meantime, something like this should work:
>>>
>>> @b.alert.ok
>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>> @b.button(id: "NavContinue").click
>>>
>>>
>>> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
>>> >
>>> > Hi Titus,
>>> >
>>> > Here is the gist url
>>> >
>>> >
>>> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>>> >
>>> > --
>>> > 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
I'm not sure what needs to happen after the click since that's where it is 
failing. But this code can't hurt because if there is no spinner it will 
move on to the next thing right away


On Tuesday, November 6, 2018 at 12:27:08 PM UTC-6, rajagopalan madasami 
wrote:
>
> Hi Titus,
>
> Can you please let me know whether my code is okay now?
>
>
> def waitAndClickButton(locator, action, name, data)
>   puts "ClickButton   : #{name}"
>   sleep 2
>   loc = getLocator(locator)
>   @b.div(id: "spinnerOverlay").wait_while(&:present?)
>   @b.button(loc.first => loc.last).click
>   @b.div(id: "spinnerOverlay").wait_while(&:present?)
> end
>
>
> On Tue, 6 Nov 2018 at 23:46, Titus Fortner  > wrote:
>
>> I posted it above:
>> @b.alert.ok 
>> @b.div(id: "spinnerOverlay").wait_while(&:present?) 
>> @b.button(id: "NavContinue").click 
>>
>> But we can make this better in the Watir code which is why I asked if you 
>> could also raise the issue on Github.
>>
>>
>>
>> On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami 
>> wrote:
>>>
>>> Okay. Can you please tell me what order should I need to write the code? 
>>>
>>> And I have a question, If element goes stale then WATIR automatically 
>>> regains the element , right ? It regain in many places which I see.
>>>
>>> On Tue 6 Nov, 2018, 11:39 PM Titus Fortner >>
 It's failing because it goes stale. It goes stale because there is a 
 refresh on the page, the refresh on the page happens after the spinner 
 that 
 the alert kicks off. The problem is that the element is located before the 
 spinner, and for it to work right now, you have to wait until after the 
 spinner to locate the element. However you organize it in the code, it 
 needs to be in that order not the order you have.



 On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan madasami 
 wrote:
>
> I am calling this function 
>
> def waitForPageLoad
>
>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
> (jQuery.active === 0)").eql? true}
> end
>
> function in every click function like
>
> def clickButton(locator, action, name, data)
>   puts "ClickButton   : #{name}"
>   loc = getLocator(locator)
>   @b.button(loc.first => loc.last).click
>   waitForPageLoad
> end
>
> Do you see the clickButton method 
>
> calls waitForPageLoad at the end so it waits for the spinner disappear. 
> So it doesn't click on the spinner. Even if it clicks at the 
>
> spinner it retry it because I have included 
> Selenium::WebDriver::Error::ElementClickInterceptedError
>
> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>   raise_present unless Wait.timer.remaining_time.positive?
>   raise_present unless %i[wait_for_present wait_for_enabled 
> wait_for_writable].include?(precondition)
>   retry
>
> So all I am seeing here is, It perfectlys lands on a page, and it 
> successfully enters into the click method but it waits for 30 seconds and 
> it fails. 
>
>   
>
>
> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  
> wrote:
>
>> Yes, this makes sense from the code perspective.
>>
>> What your site is doing is requiring you to accept an alert, then it
>> does some kind of processing, then it refreshes some/all of the page.
>>
>> Your code is trying to click the element before the refresh has
>> happened, and because of the way you are rescuing it, it is giving you
>> misleading information. The element was located but couldn't be used,
>> then at the point it is trying to be used it is stale, and that method
>> isn't relocating when stale.
>>
>> Can you raise an issue on Github with this gist? Something like "Watir
>> should relocate stale elements when trying to click them"
>>
>> In the meantime, something like this should work:
>>
>> @b.alert.ok
>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>> @b.button(id: "NavContinue").click
>>
>>
>> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
>> >
>> > Hi Titus,
>> >
>> > Here is the gist url
>> >
>> > 
>> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>> >
>> > --
>> > --
>> > 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-genera...@googlegroups.com
>> > ---
>> > You received this message because you are subscribed to the Google 
>> Groups "Watir General" group.
>> > To unsubscribe from this 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
This is the alert click here:
https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de#file-gistfile1-txt-L2732


On Tuesday, November 6, 2018 at 12:20:07 PM UTC-6, rajagopalan madasami 
wrote:
>
> I am not clicking any alert before the button. And also Let me check your 
> solution first and if it works fine then I raise the defect. So now I need 
> to wait for spinner to disappear before and after the click. Okay.
>
> On Tue 6 Nov, 2018, 11:46 PM Titus Fortner   wrote:
>
>> I posted it above:
>> @b.alert.ok 
>> @b.div(id: "spinnerOverlay").wait_while(&:present?) 
>> @b.button(id: "NavContinue").click 
>>
>> But we can make this better in the Watir code which is why I asked if you 
>> could also raise the issue on Github.
>>
>>
>>
>> On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami 
>> wrote:
>>>
>>> Okay. Can you please tell me what order should I need to write the code? 
>>>
>>> And I have a question, If element goes stale then WATIR automatically 
>>> regains the element , right ? It regain in many places which I see.
>>>
>>> On Tue 6 Nov, 2018, 11:39 PM Titus Fortner >>
 It's failing because it goes stale. It goes stale because there is a 
 refresh on the page, the refresh on the page happens after the spinner 
 that 
 the alert kicks off. The problem is that the element is located before the 
 spinner, and for it to work right now, you have to wait until after the 
 spinner to locate the element. However you organize it in the code, it 
 needs to be in that order not the order you have.



 On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan madasami 
 wrote:
>
> I am calling this function 
>
> def waitForPageLoad
>
>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
> (jQuery.active === 0)").eql? true}
> end
>
> function in every click function like
>
> def clickButton(locator, action, name, data)
>   puts "ClickButton   : #{name}"
>   loc = getLocator(locator)
>   @b.button(loc.first => loc.last).click
>   waitForPageLoad
> end
>
> Do you see the clickButton method 
>
> calls waitForPageLoad at the end so it waits for the spinner disappear. 
> So it doesn't click on the spinner. Even if it clicks at the 
>
> spinner it retry it because I have included 
> Selenium::WebDriver::Error::ElementClickInterceptedError
>
> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>   raise_present unless Wait.timer.remaining_time.positive?
>   raise_present unless %i[wait_for_present wait_for_enabled 
> wait_for_writable].include?(precondition)
>   retry
>
> So all I am seeing here is, It perfectlys lands on a page, and it 
> successfully enters into the click method but it waits for 30 seconds and 
> it fails. 
>
>   
>
>
> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  
> wrote:
>
>> Yes, this makes sense from the code perspective.
>>
>> What your site is doing is requiring you to accept an alert, then it
>> does some kind of processing, then it refreshes some/all of the page.
>>
>> Your code is trying to click the element before the refresh has
>> happened, and because of the way you are rescuing it, it is giving you
>> misleading information. The element was located but couldn't be used,
>> then at the point it is trying to be used it is stale, and that method
>> isn't relocating when stale.
>>
>> Can you raise an issue on Github with this gist? Something like "Watir
>> should relocate stale elements when trying to click them"
>>
>> In the meantime, something like this should work:
>>
>> @b.alert.ok
>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>> @b.button(id: "NavContinue").click
>>
>>
>> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
>> >
>> > Hi Titus,
>> >
>> > Here is the gist url
>> >
>> > 
>> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>> >
>> > --
>> > --
>> > 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-genera...@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-genera...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> -- 
>> -- 
>> 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
Hi Titus,

Can you please let me know whether my code is okay now?


def waitAndClickButton(locator, action, name, data)
  puts "ClickButton   : #{name}"
  sleep 2
  loc = getLocator(locator)
  @b.div(id: "spinnerOverlay").wait_while(&:present?)
  @b.button(loc.first => loc.last).click
  @b.div(id: "spinnerOverlay").wait_while(&:present?)
end


On Tue, 6 Nov 2018 at 23:46, Titus Fortner  wrote:

> I posted it above:
> @b.alert.ok
> @b.div(id: "spinnerOverlay").wait_while(&:present?)
> @b.button(id: "NavContinue").click
>
> But we can make this better in the Watir code which is why I asked if you
> could also raise the issue on Github.
>
>
>
> On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami
> wrote:
>>
>> Okay. Can you please tell me what order should I need to write the code?
>>
>> And I have a question, If element goes stale then WATIR automatically
>> regains the element , right ? It regain in many places which I see.
>>
>> On Tue 6 Nov, 2018, 11:39 PM Titus Fortner >
>>> It's failing because it goes stale. It goes stale because there is a
>>> refresh on the page, the refresh on the page happens after the spinner that
>>> the alert kicks off. The problem is that the element is located before the
>>> spinner, and for it to work right now, you have to wait until after the
>>> spinner to locate the element. However you organize it in the code, it
>>> needs to be in that order not the order you have.
>>>
>>>
>>>
>>> On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan madasami
>>> wrote:

 I am calling this function

 def waitForPageLoad

   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
 (jQuery.active === 0)").eql? true}
 end

 function in every click function like

 def clickButton(locator, action, name, data)
   puts "ClickButton   : #{name}"
   loc = getLocator(locator)
   @b.button(loc.first => loc.last).click
   waitForPageLoad
 end

 Do you see the clickButton method

 calls waitForPageLoad at the end so it waits for the spinner disappear. So 
 it doesn't click on the spinner. Even if it clicks at the

 spinner it retry it because I have included 
 Selenium::WebDriver::Error::ElementClickInterceptedError

 rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
 Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
   raise_present unless Wait.timer.remaining_time.positive?
   raise_present unless %i[wait_for_present wait_for_enabled 
 wait_for_writable].include?(precondition)
   retry

 So all I am seeing here is, It perfectlys lands on a page, and it 
 successfully enters into the click method but it waits for 30 seconds and 
 it fails.




 On Tue, 6 Nov 2018 at 22:51, Titus Fortner  wrote:

> Yes, this makes sense from the code perspective.
>
> What your site is doing is requiring you to accept an alert, then it
> does some kind of processing, then it refreshes some/all of the page.
>
> Your code is trying to click the element before the refresh has
> happened, and because of the way you are rescuing it, it is giving you
> misleading information. The element was located but couldn't be used,
> then at the point it is trying to be used it is stale, and that method
> isn't relocating when stale.
>
> Can you raise an issue on Github with this gist? Something like "Watir
> should relocate stale elements when trying to click them"
>
> In the meantime, something like this should work:
>
> @b.alert.ok
> @b.div(id: "spinnerOverlay").wait_while(&:present?)
> @b.button(id: "NavContinue").click
>
>
> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
> >
> > Hi Titus,
> >
> > Here is the gist url
> >
> >
> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
> >
> > --
> > --
> > 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-genera...@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-genera...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> --
> 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
> 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
I am not clicking any alert before the button. And also Let me check your
solution first and if it works fine then I raise the defect. So now I need
to wait for spinner to disappear before and after the click. Okay.

On Tue 6 Nov, 2018, 11:46 PM Titus Fortner  I posted it above:
> @b.alert.ok
> @b.div(id: "spinnerOverlay").wait_while(&:present?)
> @b.button(id: "NavContinue").click
>
> But we can make this better in the Watir code which is why I asked if you
> could also raise the issue on Github.
>
>
>
> On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami
> wrote:
>>
>> Okay. Can you please tell me what order should I need to write the code?
>>
>> And I have a question, If element goes stale then WATIR automatically
>> regains the element , right ? It regain in many places which I see.
>>
>> On Tue 6 Nov, 2018, 11:39 PM Titus Fortner >
>>> It's failing because it goes stale. It goes stale because there is a
>>> refresh on the page, the refresh on the page happens after the spinner that
>>> the alert kicks off. The problem is that the element is located before the
>>> spinner, and for it to work right now, you have to wait until after the
>>> spinner to locate the element. However you organize it in the code, it
>>> needs to be in that order not the order you have.
>>>
>>>
>>>
>>> On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan madasami
>>> wrote:

 I am calling this function

 def waitForPageLoad

   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
 (jQuery.active === 0)").eql? true}
 end

 function in every click function like

 def clickButton(locator, action, name, data)
   puts "ClickButton   : #{name}"
   loc = getLocator(locator)
   @b.button(loc.first => loc.last).click
   waitForPageLoad
 end

 Do you see the clickButton method

 calls waitForPageLoad at the end so it waits for the spinner disappear. So 
 it doesn't click on the spinner. Even if it clicks at the

 spinner it retry it because I have included 
 Selenium::WebDriver::Error::ElementClickInterceptedError

 rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
 Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
   raise_present unless Wait.timer.remaining_time.positive?
   raise_present unless %i[wait_for_present wait_for_enabled 
 wait_for_writable].include?(precondition)
   retry

 So all I am seeing here is, It perfectlys lands on a page, and it 
 successfully enters into the click method but it waits for 30 seconds and 
 it fails.




 On Tue, 6 Nov 2018 at 22:51, Titus Fortner  wrote:

> Yes, this makes sense from the code perspective.
>
> What your site is doing is requiring you to accept an alert, then it
> does some kind of processing, then it refreshes some/all of the page.
>
> Your code is trying to click the element before the refresh has
> happened, and because of the way you are rescuing it, it is giving you
> misleading information. The element was located but couldn't be used,
> then at the point it is trying to be used it is stale, and that method
> isn't relocating when stale.
>
> Can you raise an issue on Github with this gist? Something like "Watir
> should relocate stale elements when trying to click them"
>
> In the meantime, something like this should work:
>
> @b.alert.ok
> @b.div(id: "spinnerOverlay").wait_while(&:present?)
> @b.button(id: "NavContinue").click
>
>
> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
> >
> > Hi Titus,
> >
> > Here is the gist url
> >
> >
> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
> >
> > --
> > --
> > 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-genera...@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-genera...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> --
> 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-genera...@googlegroups.com
> ---
> You received this message because you are subscribed to the Google

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
And, no it isn't automatically relooking up stale in the applicable method 
here, because this is not a use case we anticipated, but it is something we 
can fix.


On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami 
wrote:
>
> Okay. Can you please tell me what order should I need to write the code? 
>
> And I have a question, If element goes stale then WATIR automatically 
> regains the element , right ? It regain in many places which I see.
>
> On Tue 6 Nov, 2018, 11:39 PM Titus Fortner   wrote:
>
>> It's failing because it goes stale. It goes stale because there is a 
>> refresh on the page, the refresh on the page happens after the spinner that 
>> the alert kicks off. The problem is that the element is located before the 
>> spinner, and for it to work right now, you have to wait until after the 
>> spinner to locate the element. However you organize it in the code, it 
>> needs to be in that order not the order you have.
>>
>>
>>
>> On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan madasami 
>> wrote:
>>>
>>> I am calling this function 
>>>
>>> def waitForPageLoad
>>>
>>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>>> (jQuery.active === 0)").eql? true}
>>> end
>>>
>>> function in every click function like
>>>
>>> def clickButton(locator, action, name, data)
>>>   puts "ClickButton   : #{name}"
>>>   loc = getLocator(locator)
>>>   @b.button(loc.first => loc.last).click
>>>   waitForPageLoad
>>> end
>>>
>>> Do you see the clickButton method 
>>>
>>> calls waitForPageLoad at the end so it waits for the spinner disappear. So 
>>> it doesn't click on the spinner. Even if it clicks at the 
>>>
>>> spinner it retry it because I have included 
>>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>>
>>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>>   raise_present unless Wait.timer.remaining_time.positive?
>>>   raise_present unless %i[wait_for_present wait_for_enabled 
>>> wait_for_writable].include?(precondition)
>>>   retry
>>>
>>> So all I am seeing here is, It perfectlys lands on a page, and it 
>>> successfully enters into the click method but it waits for 30 seconds and 
>>> it fails. 
>>>
>>>   
>>>
>>>
>>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  wrote:
>>>
 Yes, this makes sense from the code perspective.

 What your site is doing is requiring you to accept an alert, then it
 does some kind of processing, then it refreshes some/all of the page.

 Your code is trying to click the element before the refresh has
 happened, and because of the way you are rescuing it, it is giving you
 misleading information. The element was located but couldn't be used,
 then at the point it is trying to be used it is stale, and that method
 isn't relocating when stale.

 Can you raise an issue on Github with this gist? Something like "Watir
 should relocate stale elements when trying to click them"

 In the meantime, something like this should work:

 @b.alert.ok
 @b.div(id: "spinnerOverlay").wait_while(&:present?)
 @b.button(id: "NavContinue").click


 On Tue, Nov 6, 2018 at 10:56 AM  wrote:
 >
 > Hi Titus,
 >
 > Here is the gist url
 >
 > 
 https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
 >
 > --
 > --
 > 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-genera...@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-genera...@googlegroups.com.
 > For more options, visit https://groups.google.com/d/optout.

 -- 
 -- 
 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-genera...@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-genera...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>> -- 
>> -- 
>> 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 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
Hi thanks. Right now recording is easy for me. I have fast stone recorder,
I can record, its not a problem. But your gem is useful because I can
record test cases to see later.

On Tue 6 Nov, 2018, 11:41 PM Lakshya Kapoor  Perfect time to share a gem I am working on :)
>
> https://github.com/kapoorlakshya/ffmpeg-screenrecorder
>
> This should help you create a video recording of your test execution. You
> can then host it on streamable or YouTube.
>
> On Tuesday, November 6, 2018 at 10:05:04 AM UTC-8, rajagopalan madasami
> wrote:
>>
>> Hi Justin, I can share my screen if you want. You can take control of my
>> system. Do you have team viewer or do you have any business skype? I can
>> share my screen via that.
>>
>> On Tue 6 Nov, 2018, 11:27 PM Justin Ko >
>>> Any chance you can capture a video of the test? It's hard to reconcile
>>> this discussion and logs without seeing anything.
>>>
>>> Justin
>>>
>>> On Tuesday, November 6, 2018 at 12:37:01 PM UTC-5, rajagopalan madasami
>>> wrote:

 I am calling this function

 def waitForPageLoad

   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
 (jQuery.active === 0)").eql? true}
 end

 function in every click function like

 def clickButton(locator, action, name, data)
   puts "ClickButton   : #{name}"
   loc = getLocator(locator)
   @b.button(loc.first => loc.last).click
   waitForPageLoad
 end

 Do you see the clickButton method

 calls waitForPageLoad at the end so it waits for the spinner disappear. So 
 it doesn't click on the spinner. Even if it clicks at the

 spinner it retry it because I have included 
 Selenium::WebDriver::Error::ElementClickInterceptedError

 rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
 Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
   raise_present unless Wait.timer.remaining_time.positive?
   raise_present unless %i[wait_for_present wait_for_enabled 
 wait_for_writable].include?(precondition)
   retry

 So all I am seeing here is, It perfectlys lands on a page, and it 
 successfully enters into the click method but it waits for 30 seconds and 
 it fails.




 On Tue, 6 Nov 2018 at 22:51, Titus Fortner  wrote:

> Yes, this makes sense from the code perspective.
>
> What your site is doing is requiring you to accept an alert, then it
> does some kind of processing, then it refreshes some/all of the page.
>
> Your code is trying to click the element before the refresh has
> happened, and because of the way you are rescuing it, it is giving you
> misleading information. The element was located but couldn't be used,
> then at the point it is trying to be used it is stale, and that method
> isn't relocating when stale.
>
> Can you raise an issue on Github with this gist? Something like "Watir
> should relocate stale elements when trying to click them"
>
> In the meantime, something like this should work:
>
> @b.alert.ok
> @b.div(id: "spinnerOverlay").wait_while(&:present?)
> @b.button(id: "NavContinue").click
>
>
> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
> >
> > Hi Titus,
> >
> > Here is the gist url
> >
> >
> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
> >
> > --
> > --
> > 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-genera...@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-genera...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> --
> 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-genera...@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-genera...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
 --
>>> --
>>> Before posting, please read
>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
>>>
>>> In short: 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
I posted it above:
@b.alert.ok 
@b.div(id: "spinnerOverlay").wait_while(&:present?) 
@b.button(id: "NavContinue").click 

But we can make this better in the Watir code which is why I asked if you 
could also raise the issue on Github.



On Tuesday, November 6, 2018 at 12:12:32 PM UTC-6, rajagopalan madasami 
wrote:
>
> Okay. Can you please tell me what order should I need to write the code? 
>
> And I have a question, If element goes stale then WATIR automatically 
> regains the element , right ? It regain in many places which I see.
>
> On Tue 6 Nov, 2018, 11:39 PM Titus Fortner   wrote:
>
>> It's failing because it goes stale. It goes stale because there is a 
>> refresh on the page, the refresh on the page happens after the spinner that 
>> the alert kicks off. The problem is that the element is located before the 
>> spinner, and for it to work right now, you have to wait until after the 
>> spinner to locate the element. However you organize it in the code, it 
>> needs to be in that order not the order you have.
>>
>>
>>
>> On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan madasami 
>> wrote:
>>>
>>> I am calling this function 
>>>
>>> def waitForPageLoad
>>>
>>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>>> (jQuery.active === 0)").eql? true}
>>> end
>>>
>>> function in every click function like
>>>
>>> def clickButton(locator, action, name, data)
>>>   puts "ClickButton   : #{name}"
>>>   loc = getLocator(locator)
>>>   @b.button(loc.first => loc.last).click
>>>   waitForPageLoad
>>> end
>>>
>>> Do you see the clickButton method 
>>>
>>> calls waitForPageLoad at the end so it waits for the spinner disappear. So 
>>> it doesn't click on the spinner. Even if it clicks at the 
>>>
>>> spinner it retry it because I have included 
>>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>>
>>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>>   raise_present unless Wait.timer.remaining_time.positive?
>>>   raise_present unless %i[wait_for_present wait_for_enabled 
>>> wait_for_writable].include?(precondition)
>>>   retry
>>>
>>> So all I am seeing here is, It perfectlys lands on a page, and it 
>>> successfully enters into the click method but it waits for 30 seconds and 
>>> it fails. 
>>>
>>>   
>>>
>>>
>>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  wrote:
>>>
 Yes, this makes sense from the code perspective.

 What your site is doing is requiring you to accept an alert, then it
 does some kind of processing, then it refreshes some/all of the page.

 Your code is trying to click the element before the refresh has
 happened, and because of the way you are rescuing it, it is giving you
 misleading information. The element was located but couldn't be used,
 then at the point it is trying to be used it is stale, and that method
 isn't relocating when stale.

 Can you raise an issue on Github with this gist? Something like "Watir
 should relocate stale elements when trying to click them"

 In the meantime, something like this should work:

 @b.alert.ok
 @b.div(id: "spinnerOverlay").wait_while(&:present?)
 @b.button(id: "NavContinue").click


 On Tue, Nov 6, 2018 at 10:56 AM  wrote:
 >
 > Hi Titus,
 >
 > Here is the gist url
 >
 > 
 https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
 >
 > --
 > --
 > 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-genera...@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-genera...@googlegroups.com.
 > For more options, visit https://groups.google.com/d/optout.

 -- 
 -- 
 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-genera...@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-genera...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>> -- 
>> -- 
>> Before posting, please read 
>> 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
Okay. Can you please tell me what order should I need to write the code?

And I have a question, If element goes stale then WATIR automatically
regains the element , right ? It regain in many places which I see.

On Tue 6 Nov, 2018, 11:39 PM Titus Fortner  It's failing because it goes stale. It goes stale because there is a
> refresh on the page, the refresh on the page happens after the spinner that
> the alert kicks off. The problem is that the element is located before the
> spinner, and for it to work right now, you have to wait until after the
> spinner to locate the element. However you organize it in the code, it
> needs to be in that order not the order you have.
>
>
>
> On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan madasami
> wrote:
>>
>> I am calling this function
>>
>> def waitForPageLoad
>>
>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>> (jQuery.active === 0)").eql? true}
>> end
>>
>> function in every click function like
>>
>> def clickButton(locator, action, name, data)
>>   puts "ClickButton   : #{name}"
>>   loc = getLocator(locator)
>>   @b.button(loc.first => loc.last).click
>>   waitForPageLoad
>> end
>>
>> Do you see the clickButton method
>>
>> calls waitForPageLoad at the end so it waits for the spinner disappear. So 
>> it doesn't click on the spinner. Even if it clicks at the
>>
>> spinner it retry it because I have included 
>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>
>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>   raise_present unless Wait.timer.remaining_time.positive?
>>   raise_present unless %i[wait_for_present wait_for_enabled 
>> wait_for_writable].include?(precondition)
>>   retry
>>
>> So all I am seeing here is, It perfectlys lands on a page, and it 
>> successfully enters into the click method but it waits for 30 seconds and it 
>> fails.
>>
>>
>>
>>
>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  wrote:
>>
>>> Yes, this makes sense from the code perspective.
>>>
>>> What your site is doing is requiring you to accept an alert, then it
>>> does some kind of processing, then it refreshes some/all of the page.
>>>
>>> Your code is trying to click the element before the refresh has
>>> happened, and because of the way you are rescuing it, it is giving you
>>> misleading information. The element was located but couldn't be used,
>>> then at the point it is trying to be used it is stale, and that method
>>> isn't relocating when stale.
>>>
>>> Can you raise an issue on Github with this gist? Something like "Watir
>>> should relocate stale elements when trying to click them"
>>>
>>> In the meantime, something like this should work:
>>>
>>> @b.alert.ok
>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>> @b.button(id: "NavContinue").click
>>>
>>>
>>> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
>>> >
>>> > Hi Titus,
>>> >
>>> > Here is the gist url
>>> >
>>> > https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>>> >
>>> > --
>>> > --
>>> > 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-genera...@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-genera...@googlegroups.com.
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>>> --
>>> 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-genera...@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-genera...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> --
> 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.
>

-- 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Lakshya Kapoor
Perfect time to share a gem I am working on :)

https://github.com/kapoorlakshya/ffmpeg-screenrecorder

This should help you create a video recording of your test execution. You 
can then host it on streamable or YouTube.

On Tuesday, November 6, 2018 at 10:05:04 AM UTC-8, rajagopalan madasami 
wrote:
>
> Hi Justin, I can share my screen if you want. You can take control of my 
> system. Do you have team viewer or do you have any business skype? I can 
> share my screen via that.
>
> On Tue 6 Nov, 2018, 11:27 PM Justin Ko  
> wrote:
>
>> Any chance you can capture a video of the test? It's hard to reconcile 
>> this discussion and logs without seeing anything.
>>
>> Justin
>>
>> On Tuesday, November 6, 2018 at 12:37:01 PM UTC-5, rajagopalan madasami 
>> wrote:
>>>
>>> I am calling this function 
>>>
>>> def waitForPageLoad
>>>
>>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>>> (jQuery.active === 0)").eql? true}
>>> end
>>>
>>> function in every click function like
>>>
>>> def clickButton(locator, action, name, data)
>>>   puts "ClickButton   : #{name}"
>>>   loc = getLocator(locator)
>>>   @b.button(loc.first => loc.last).click
>>>   waitForPageLoad
>>> end
>>>
>>> Do you see the clickButton method 
>>>
>>> calls waitForPageLoad at the end so it waits for the spinner disappear. So 
>>> it doesn't click on the spinner. Even if it clicks at the 
>>>
>>> spinner it retry it because I have included 
>>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>>
>>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>>   raise_present unless Wait.timer.remaining_time.positive?
>>>   raise_present unless %i[wait_for_present wait_for_enabled 
>>> wait_for_writable].include?(precondition)
>>>   retry
>>>
>>> So all I am seeing here is, It perfectlys lands on a page, and it 
>>> successfully enters into the click method but it waits for 30 seconds and 
>>> it fails. 
>>>
>>>   
>>>
>>>
>>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  wrote:
>>>
 Yes, this makes sense from the code perspective.

 What your site is doing is requiring you to accept an alert, then it
 does some kind of processing, then it refreshes some/all of the page.

 Your code is trying to click the element before the refresh has
 happened, and because of the way you are rescuing it, it is giving you
 misleading information. The element was located but couldn't be used,
 then at the point it is trying to be used it is stale, and that method
 isn't relocating when stale.

 Can you raise an issue on Github with this gist? Something like "Watir
 should relocate stale elements when trying to click them"

 In the meantime, something like this should work:

 @b.alert.ok
 @b.div(id: "spinnerOverlay").wait_while(&:present?)
 @b.button(id: "NavContinue").click


 On Tue, Nov 6, 2018 at 10:56 AM  wrote:
 >
 > Hi Titus,
 >
 > Here is the gist url
 >
 > 
 https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
 >
 > --
 > --
 > 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-genera...@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-genera...@googlegroups.com.
 > For more options, visit https://groups.google.com/d/optout.

 -- 
 -- 
 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-genera...@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-genera...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>> -- 
>> -- 
>> 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-genera...@googlegroups.com 
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Watir General" group.
>> To unsubscribe from this group and stop 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
It's failing because it goes stale. It goes stale because there is a 
refresh on the page, the refresh on the page happens after the spinner that 
the alert kicks off. The problem is that the element is located before the 
spinner, and for it to work right now, you have to wait until after the 
spinner to locate the element. However you organize it in the code, it 
needs to be in that order not the order you have.



On Tuesday, November 6, 2018 at 11:37:01 AM UTC-6, rajagopalan madasami 
wrote:
>
> I am calling this function 
>
> def waitForPageLoad
>
>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
> (jQuery.active === 0)").eql? true}
> end
>
> function in every click function like
>
> def clickButton(locator, action, name, data)
>   puts "ClickButton   : #{name}"
>   loc = getLocator(locator)
>   @b.button(loc.first => loc.last).click
>   waitForPageLoad
> end
>
> Do you see the clickButton method 
>
> calls waitForPageLoad at the end so it waits for the spinner disappear. So it 
> doesn't click on the spinner. Even if it clicks at the 
>
> spinner it retry it because I have included 
> Selenium::WebDriver::Error::ElementClickInterceptedError
>
> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>   raise_present unless Wait.timer.remaining_time.positive?
>   raise_present unless %i[wait_for_present wait_for_enabled 
> wait_for_writable].include?(precondition)
>   retry
>
> So all I am seeing here is, It perfectlys lands on a page, and it 
> successfully enters into the click method but it waits for 30 seconds and it 
> fails. 
>
>   
>
>
> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  > wrote:
>
>> Yes, this makes sense from the code perspective.
>>
>> What your site is doing is requiring you to accept an alert, then it
>> does some kind of processing, then it refreshes some/all of the page.
>>
>> Your code is trying to click the element before the refresh has
>> happened, and because of the way you are rescuing it, it is giving you
>> misleading information. The element was located but couldn't be used,
>> then at the point it is trying to be used it is stale, and that method
>> isn't relocating when stale.
>>
>> Can you raise an issue on Github with this gist? Something like "Watir
>> should relocate stale elements when trying to click them"
>>
>> In the meantime, something like this should work:
>>
>> @b.alert.ok
>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>> @b.button(id: "NavContinue").click
>>
>>
>> On Tue, Nov 6, 2018 at 10:56 AM > 
>> wrote:
>> >
>> > Hi Titus,
>> >
>> > Here is the gist url
>> >
>> > https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>> >
>> > --
>> > --
>> > 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-genera...@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-genera...@googlegroups.com .
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> -- 
>> -- 
>> 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-genera...@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-genera...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
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.


Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
Hi Justin, I can share my screen if you want. You can take control of my
system. Do you have team viewer or do you have any business skype? I can
share my screen via that.

On Tue 6 Nov, 2018, 11:27 PM Justin Ko  Any chance you can capture a video of the test? It's hard to reconcile
> this discussion and logs without seeing anything.
>
> Justin
>
> On Tuesday, November 6, 2018 at 12:37:01 PM UTC-5, rajagopalan madasami
> wrote:
>>
>> I am calling this function
>>
>> def waitForPageLoad
>>
>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>> (jQuery.active === 0)").eql? true}
>> end
>>
>> function in every click function like
>>
>> def clickButton(locator, action, name, data)
>>   puts "ClickButton   : #{name}"
>>   loc = getLocator(locator)
>>   @b.button(loc.first => loc.last).click
>>   waitForPageLoad
>> end
>>
>> Do you see the clickButton method
>>
>> calls waitForPageLoad at the end so it waits for the spinner disappear. So 
>> it doesn't click on the spinner. Even if it clicks at the
>>
>> spinner it retry it because I have included 
>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>
>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>   raise_present unless Wait.timer.remaining_time.positive?
>>   raise_present unless %i[wait_for_present wait_for_enabled 
>> wait_for_writable].include?(precondition)
>>   retry
>>
>> So all I am seeing here is, It perfectlys lands on a page, and it 
>> successfully enters into the click method but it waits for 30 seconds and it 
>> fails.
>>
>>
>>
>>
>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  wrote:
>>
>>> Yes, this makes sense from the code perspective.
>>>
>>> What your site is doing is requiring you to accept an alert, then it
>>> does some kind of processing, then it refreshes some/all of the page.
>>>
>>> Your code is trying to click the element before the refresh has
>>> happened, and because of the way you are rescuing it, it is giving you
>>> misleading information. The element was located but couldn't be used,
>>> then at the point it is trying to be used it is stale, and that method
>>> isn't relocating when stale.
>>>
>>> Can you raise an issue on Github with this gist? Something like "Watir
>>> should relocate stale elements when trying to click them"
>>>
>>> In the meantime, something like this should work:
>>>
>>> @b.alert.ok
>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>> @b.button(id: "NavContinue").click
>>>
>>>
>>> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
>>> >
>>> > Hi Titus,
>>> >
>>> > Here is the gist url
>>> >
>>> > https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>>> >
>>> > --
>>> > --
>>> > 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-genera...@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-genera...@googlegroups.com.
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>>> --
>>> 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-genera...@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-genera...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> --
> 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.
>

-- 
-- 
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 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
HI Justin,

I can share my screen if you want. You can take control of my system and
see what happens. Can you ?

On Tue, 6 Nov 2018 at 23:27, Justin Ko  wrote:

> Any chance you can capture a video of the test? It's hard to reconcile
> this discussion and logs without seeing anything.
>
> Justin
>
> On Tuesday, November 6, 2018 at 12:37:01 PM UTC-5, rajagopalan madasami
> wrote:
>>
>> I am calling this function
>>
>> def waitForPageLoad
>>
>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>> (jQuery.active === 0)").eql? true}
>> end
>>
>> function in every click function like
>>
>> def clickButton(locator, action, name, data)
>>   puts "ClickButton   : #{name}"
>>   loc = getLocator(locator)
>>   @b.button(loc.first => loc.last).click
>>   waitForPageLoad
>> end
>>
>> Do you see the clickButton method
>>
>> calls waitForPageLoad at the end so it waits for the spinner disappear. So 
>> it doesn't click on the spinner. Even if it clicks at the
>>
>> spinner it retry it because I have included 
>> Selenium::WebDriver::Error::ElementClickInterceptedError
>>
>> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
>> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>>   raise_present unless Wait.timer.remaining_time.positive?
>>   raise_present unless %i[wait_for_present wait_for_enabled 
>> wait_for_writable].include?(precondition)
>>   retry
>>
>> So all I am seeing here is, It perfectlys lands on a page, and it 
>> successfully enters into the click method but it waits for 30 seconds and it 
>> fails.
>>
>>
>>
>>
>> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  wrote:
>>
>>> Yes, this makes sense from the code perspective.
>>>
>>> What your site is doing is requiring you to accept an alert, then it
>>> does some kind of processing, then it refreshes some/all of the page.
>>>
>>> Your code is trying to click the element before the refresh has
>>> happened, and because of the way you are rescuing it, it is giving you
>>> misleading information. The element was located but couldn't be used,
>>> then at the point it is trying to be used it is stale, and that method
>>> isn't relocating when stale.
>>>
>>> Can you raise an issue on Github with this gist? Something like "Watir
>>> should relocate stale elements when trying to click them"
>>>
>>> In the meantime, something like this should work:
>>>
>>> @b.alert.ok
>>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>>> @b.button(id: "NavContinue").click
>>>
>>>
>>> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
>>> >
>>> > Hi Titus,
>>> >
>>> > Here is the gist url
>>> >
>>> > https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>>> >
>>> > --
>>> > --
>>> > 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-genera...@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-genera...@googlegroups.com.
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>>> --
>>> 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-genera...@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-genera...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> --
> 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.
>

-- 
-- 
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 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Justin Ko
Any chance you can capture a video of the test? It's hard to reconcile this 
discussion and logs without seeing anything.

Justin

On Tuesday, November 6, 2018 at 12:37:01 PM UTC-5, rajagopalan madasami 
wrote:
>
> I am calling this function 
>
> def waitForPageLoad
>
>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
> (jQuery.active === 0)").eql? true}
> end
>
> function in every click function like
>
> def clickButton(locator, action, name, data)
>   puts "ClickButton   : #{name}"
>   loc = getLocator(locator)
>   @b.button(loc.first => loc.last).click
>   waitForPageLoad
> end
>
> Do you see the clickButton method 
>
> calls waitForPageLoad at the end so it waits for the spinner disappear. So it 
> doesn't click on the spinner. Even if it clicks at the 
>
> spinner it retry it because I have included 
> Selenium::WebDriver::Error::ElementClickInterceptedError
>
> rescue Selenium::WebDriver::Error::ElementNotVisibleError, 
> Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
>   raise_present unless Wait.timer.remaining_time.positive?
>   raise_present unless %i[wait_for_present wait_for_enabled 
> wait_for_writable].include?(precondition)
>   retry
>
> So all I am seeing here is, It perfectlys lands on a page, and it 
> successfully enters into the click method but it waits for 30 seconds and it 
> fails. 
>
>   
>
>
> On Tue, 6 Nov 2018 at 22:51, Titus Fortner  > wrote:
>
>> Yes, this makes sense from the code perspective.
>>
>> What your site is doing is requiring you to accept an alert, then it
>> does some kind of processing, then it refreshes some/all of the page.
>>
>> Your code is trying to click the element before the refresh has
>> happened, and because of the way you are rescuing it, it is giving you
>> misleading information. The element was located but couldn't be used,
>> then at the point it is trying to be used it is stale, and that method
>> isn't relocating when stale.
>>
>> Can you raise an issue on Github with this gist? Something like "Watir
>> should relocate stale elements when trying to click them"
>>
>> In the meantime, something like this should work:
>>
>> @b.alert.ok
>> @b.div(id: "spinnerOverlay").wait_while(&:present?)
>> @b.button(id: "NavContinue").click
>>
>>
>> On Tue, Nov 6, 2018 at 10:56 AM > 
>> wrote:
>> >
>> > Hi Titus,
>> >
>> > Here is the gist url
>> >
>> > https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>> >
>> > --
>> > --
>> > 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-genera...@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-genera...@googlegroups.com .
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> -- 
>> -- 
>> 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-genera...@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-genera...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
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.


Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
I am calling this function

def waitForPageLoad

  @b.wait_until(timeout: @Page_Load) {@b.execute_script("return
(jQuery.active === 0)").eql? true}
end

function in every click function like

def clickButton(locator, action, name, data)
  puts "ClickButton   : #{name}"
  loc = getLocator(locator)
  @b.button(loc.first => loc.last).click
  waitForPageLoad
end

Do you see the clickButton method

calls waitForPageLoad at the end so it waits for the spinner
disappear. So it doesn't click on the spinner. Even if it clicks at
the

spinner it retry it because I have included
Selenium::WebDriver::Error::ElementClickInterceptedError

rescue Selenium::WebDriver::Error::ElementNotVisibleError,
Selenium::WebDriver::Error::ElementNotInteractableError,Selenium::WebDriver::Error::ElementClickInterceptedError
  raise_present unless Wait.timer.remaining_time.positive?
  raise_present unless %i[wait_for_present wait_for_enabled
wait_for_writable].include?(precondition)
  retry

So all I am seeing here is, It perfectlys lands on a page, and it
successfully enters into the click method but it waits for 30 seconds
and it fails.




On Tue, 6 Nov 2018 at 22:51, Titus Fortner  wrote:

> Yes, this makes sense from the code perspective.
>
> What your site is doing is requiring you to accept an alert, then it
> does some kind of processing, then it refreshes some/all of the page.
>
> Your code is trying to click the element before the refresh has
> happened, and because of the way you are rescuing it, it is giving you
> misleading information. The element was located but couldn't be used,
> then at the point it is trying to be used it is stale, and that method
> isn't relocating when stale.
>
> Can you raise an issue on Github with this gist? Something like "Watir
> should relocate stale elements when trying to click them"
>
> In the meantime, something like this should work:
>
> @b.alert.ok
> @b.div(id: "spinnerOverlay").wait_while(&:present?)
> @b.button(id: "NavContinue").click
>
>
> On Tue, Nov 6, 2018 at 10:56 AM  wrote:
> >
> > Hi Titus,
> >
> > Here is the gist url
> >
> > https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
> >
> > --
> > --
> > 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.
>
> --
> --
> 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.
>

-- 
-- 
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.


Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
There is one checkbox when I click that checkbox, it would trigger the
javascript alert when I press okay in the Javascript alert, it checkbox
gets ticked. But this happens in the very early stage of my program and it
goes very well. that's not where the problem is. The problem is it is not
clicking the continue button, page perfectly loaded and this line starts
executes b.button.click but it waits for 30 seconds and it fails by saying
'unable to locate the element. Why? It has to retry locating the element,
right? it's not doing it .

On Tue, 6 Nov 2018 at 22:50, Justin Ko  wrote:

> From the logs, I see:
>
>1. A "Checking this box will delete any prior coverages" alert is
>accepted
>2. The NavContinue button is retrieved (elementID:
>04743404-40e9-4dc0-bae8-1f3e270f3eae)
>3. Several clicks are attempted, but intercepted by id=\"spinnerOverlay\">
>4. Several clicks are attempted, but raise stale reference errors
>
> What does the application do when accepting the alert (Step 1)? Does it
> cause the overlay to be displayed and then a page refresh?
>
> Justin
>
>
> On Tuesday, November 6, 2018 at 11:56:57 AM UTC-5, rajagopal...@gmail.com
> wrote:
>>
>> Hi Titus,
>>
>> Here is the gist url
>>
>> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>>
> --
> --
> 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.
>

-- 
-- 
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.


Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
Yes, this makes sense from the code perspective.

What your site is doing is requiring you to accept an alert, then it
does some kind of processing, then it refreshes some/all of the page.

Your code is trying to click the element before the refresh has
happened, and because of the way you are rescuing it, it is giving you
misleading information. The element was located but couldn't be used,
then at the point it is trying to be used it is stale, and that method
isn't relocating when stale.

Can you raise an issue on Github with this gist? Something like "Watir
should relocate stale elements when trying to click them"

In the meantime, something like this should work:

@b.alert.ok
@b.div(id: "spinnerOverlay").wait_while(&:present?)
@b.button(id: "NavContinue").click


On Tue, Nov 6, 2018 at 10:56 AM  wrote:
>
> Hi Titus,
>
> Here is the gist url
>
> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>
> --
> --
> 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.

-- 
-- 
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.


Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Justin Ko
>From the logs, I see:

   1. A "Checking this box will delete any prior coverages" alert is 
   accepted
   2. The NavContinue button is retrieved (elementID: 
   04743404-40e9-4dc0-bae8-1f3e270f3eae)
   3. Several clicks are attempted, but intercepted by 
   4. Several clicks are attempted, but raise stale reference errors
   
What does the application do when accepting the alert (Step 1)? Does it 
cause the overlay to be displayed and then a page refresh?

Justin


On Tuesday, November 6, 2018 at 11:56:57 AM UTC-5, rajagopal...@gmail.com 
wrote:
>
> Hi Titus,
>
> Here is the gist url
>
> https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de
>

-- 
-- 
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.


Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalanmadasami
Hi Titus,

Here is the gist url

https://gist.github.com/Rajagopalan-M/ba78aed6342c61d07968cfe195d3f4de

-- 
-- 
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.


Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
Okay I got the link I send you in few minutes

On Tue 6 Nov, 2018, 10:09 PM Titus Fortner  Can you paste the log into a gist or something so it is easier to read?
>
>
> On Tuesday, November 6, 2018 at 10:20:26 AM UTC-6, rajagopalan madasami
> wrote:
>>
>> No, It throws this error unable to locate the element
>>
>>
>> *Watir::Exception::UnknownObjectException: timed out after 60 seconds,
>> waiting for #"NavContinue",
>> :tag_name=>"button"}> to be located*
>>
>>   0) AGCSquoteCreation Test1
>>  ?[31mFailure/Error: raise unknown_exception, msg?[0m
>>  ?[31m?[0m
>>  ?[31mWatir::Exception::UnknownObjectException:?[0m
>>  ?[31m  timed out after 60 seconds, waiting for #> located: true; {:id=>"NavContinue", :tag_name=>"button"}> to be located?[0m
>>  ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:30:in
>> `waitAndClickButton'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block
>> in execute'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in
>> `each'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in
>> `execute'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in
>> `call'?[0m
>>  ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in > (required)>'?[0m
>>  ?[36m# --?[0m
>>  ?[36m# --- Caused by: ---?[0m
>>  ?[36m# Watir::Wait::TimeoutError:?[0m
>>  ?[36m#   timed out after 60 seconds, waiting for true condition on
>> #"NavContinue",
>> :tag_name=>"button"}>?[0m
>>  ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:30:in
>> `waitAndClickButton'?[0m
>>
>>
>> On Tue, 6 Nov 2018 at 21:48, Titus Fortner  wrote:
>>
>> This log is showing that the click was successful, but that the jquery
>> queue never empties.
>>
>>
>>
>> On Tuesday, November 6, 2018 at 10:13:50 AM UTC-6, rajagopalan madasami
>> wrote:
>>
>> Hi Titus,
>>
>> Here is the log
>>
>> Testing started at 21:36 ...
>> C:\Ruby25\bin\ruby.exe C:\Ruby25\bin\rspec
>> C:/A/StringRay/Ruby_test_spec.rb
>> --require teamcity/spec/runner/formatter/teamcity/formatter --format
>> Spec::Runner::Formatter::TeamcityFormatter
>> C:/A/StringRay/InputFiles/Sanity1.xlsx
>> ["AGCSquoteCreation", "Test1", nil, nil]
>> nil
>> Test Starts in Latest Firefox
>> 2018-11-06 21:36:50 INFO Selenium -> POST
>> session/7e876088-d29b-4b08-90a2-6609870215df/url
>> 2018-11-06 21:36:50 INFO Selenium>>>
>> http://127.0.0.1:/session/7e876088-d29b-4b08-90a2-6609870215df/url |
>> {"url":"https://agcs-qa.maxprocessing.com/login.max?preprocess=true"}
>> 2018-11-06 21:37:44 INFO Selenium <- {"value":null}
>> Type  : User Name | testid
>> 2018-11-06 21:37:45 INFO Selenium -> POST
>> session/7e876088-d29b-4b08-90a2-6609870215df/element
>> 2018-11-06 21:37:45 INFO Selenium>>>
>> http://127.0.0.1:/session/7e876088-d29b-4b08-90a2-6609870215df/element
>> | {"using":"xpath","value":".//input[(not(@type) or
>> (translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"file\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"radio\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"checkbox\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"submit\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"reset\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"image\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"button\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"hidden\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"range\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"color\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"date\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"datetime-local\"))
>>
>> and @name='username']"}
>> 2018-11-06 21:37:45 INFO Selenium <-
>> {"value":{"element-6066-11e4-a52e-4f735466cecf":"319cbe67-1efa-4f24-a636-47d85834d4d8"}}
>>
>> 2018-11-06 21:37:45 INFO Selenium -> GET
>> session/7e876088-d29b-4b08-90a2-6609870215df/element/319cbe67-1efa-4f24-a636-47d85834d4d8/enabled
>>
>> 2018-11-06 21:37:45 INFO Selenium <- {"value":true}
>> 2018-11-06 21:37:45 INFO Selenium -> POST
>> session/7e876088-d29b-4b08-90a2-6609870215df/execute/sync
>> 2018-11-06 21:37:45 INFO Selenium>>>
>>
>> http://127.0.0.1:/session/7e876088-d29b-4b08-90a2-6609870215df/execute/sync
>> | {"script":"return (function(){return function(){var d=this;function
>> f(a){return\"string\"==typeof a};function
>> h(a,b){this.code=a;this.a=l[a]||m;this.message=b||\"\";a=this.a.replace(/((?:^|\\s+)[a-z])/g,function(a){return
>>
>> 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
Last time you gave me the gist url. Can you send again?

On Tue 6 Nov, 2018, 10:09 PM Titus Fortner  Can you paste the log into a gist or something so it is easier to read?
>
>
> On Tuesday, November 6, 2018 at 10:20:26 AM UTC-6, rajagopalan madasami
> wrote:
>>
>> No, It throws this error unable to locate the element
>>
>>
>> *Watir::Exception::UnknownObjectException: timed out after 60 seconds,
>> waiting for #"NavContinue",
>> :tag_name=>"button"}> to be located*
>>
>>   0) AGCSquoteCreation Test1
>>  ?[31mFailure/Error: raise unknown_exception, msg?[0m
>>  ?[31m?[0m
>>  ?[31mWatir::Exception::UnknownObjectException:?[0m
>>  ?[31m  timed out after 60 seconds, waiting for #> located: true; {:id=>"NavContinue", :tag_name=>"button"}> to be located?[0m
>>  ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:30:in
>> `waitAndClickButton'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block
>> in execute'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in
>> `each'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in
>> `execute'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in
>> `call'?[0m
>>  ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in > (required)>'?[0m
>>  ?[36m# --?[0m
>>  ?[36m# --- Caused by: ---?[0m
>>  ?[36m# Watir::Wait::TimeoutError:?[0m
>>  ?[36m#   timed out after 60 seconds, waiting for true condition on
>> #"NavContinue",
>> :tag_name=>"button"}>?[0m
>>  ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:30:in
>> `waitAndClickButton'?[0m
>>
>>
>> On Tue, 6 Nov 2018 at 21:48, Titus Fortner  wrote:
>>
>> This log is showing that the click was successful, but that the jquery
>> queue never empties.
>>
>>
>>
>> On Tuesday, November 6, 2018 at 10:13:50 AM UTC-6, rajagopalan madasami
>> wrote:
>>
>> Hi Titus,
>>
>> Here is the log
>>
>> Testing started at 21:36 ...
>> C:\Ruby25\bin\ruby.exe C:\Ruby25\bin\rspec
>> C:/A/StringRay/Ruby_test_spec.rb
>> --require teamcity/spec/runner/formatter/teamcity/formatter --format
>> Spec::Runner::Formatter::TeamcityFormatter
>> C:/A/StringRay/InputFiles/Sanity1.xlsx
>> ["AGCSquoteCreation", "Test1", nil, nil]
>> nil
>> Test Starts in Latest Firefox
>> 2018-11-06 21:36:50 INFO Selenium -> POST
>> session/7e876088-d29b-4b08-90a2-6609870215df/url
>> 2018-11-06 21:36:50 INFO Selenium>>>
>> http://127.0.0.1:/session/7e876088-d29b-4b08-90a2-6609870215df/url |
>> {"url":"https://agcs-qa.maxprocessing.com/login.max?preprocess=true"}
>> 2018-11-06 21:37:44 INFO Selenium <- {"value":null}
>> Type  : User Name | testid
>> 2018-11-06 21:37:45 INFO Selenium -> POST
>> session/7e876088-d29b-4b08-90a2-6609870215df/element
>> 2018-11-06 21:37:45 INFO Selenium>>>
>> http://127.0.0.1:/session/7e876088-d29b-4b08-90a2-6609870215df/element
>> | {"using":"xpath","value":".//input[(not(@type) or
>> (translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"file\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"radio\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"checkbox\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"submit\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"reset\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"image\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"button\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"hidden\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"range\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"color\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"date\"
>>
>> and
>> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"datetime-local\"))
>>
>> and @name='username']"}
>> 2018-11-06 21:37:45 INFO Selenium <-
>> {"value":{"element-6066-11e4-a52e-4f735466cecf":"319cbe67-1efa-4f24-a636-47d85834d4d8"}}
>>
>> 2018-11-06 21:37:45 INFO Selenium -> GET
>> session/7e876088-d29b-4b08-90a2-6609870215df/element/319cbe67-1efa-4f24-a636-47d85834d4d8/enabled
>>
>> 2018-11-06 21:37:45 INFO Selenium <- {"value":true}
>> 2018-11-06 21:37:45 INFO Selenium -> POST
>> session/7e876088-d29b-4b08-90a2-6609870215df/execute/sync
>> 2018-11-06 21:37:45 INFO Selenium>>>
>>
>> http://127.0.0.1:/session/7e876088-d29b-4b08-90a2-6609870215df/execute/sync
>> | {"script":"return (function(){return function(){var d=this;function
>> f(a){return\"string\"==typeof a};function
>> h(a,b){this.code=a;this.a=l[a]||m;this.message=b||\"\";a=this.a.replace(/((?:^|\\s+)[a-z])/g,function(a){return
>>
>> 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
Can you paste the log into a gist or something so it is easier to read?


On Tuesday, November 6, 2018 at 10:20:26 AM UTC-6, rajagopalan madasami 
wrote:
>
> No, It throws this error unable to locate the element
>
>
> *Watir::Exception::UnknownObjectException: timed out after 60 seconds, 
> waiting for #"NavContinue", 
> :tag_name=>"button"}> to be located*
>
>   0) AGCSquoteCreation Test1
>  ?[31mFailure/Error: raise unknown_exception, msg?[0m
>  ?[31m?[0m
>  ?[31mWatir::Exception::UnknownObjectException:?[0m
>  ?[31m  timed out after 60 seconds, waiting for # located: true; {:id=>"NavContinue", :tag_name=>"button"}> to be located?[0m
>  ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:30:in 
> `waitAndClickButton'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block in 
> execute'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in `each'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in 
> `execute'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in 
> `call'?[0m
>  ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in  (required)>'?[0m
>  ?[36m# --?[0m
>  ?[36m# --- Caused by: ---?[0m
>  ?[36m# Watir::Wait::TimeoutError:?[0m
>  ?[36m#   timed out after 60 seconds, waiting for true condition on 
> #"NavContinue", 
> :tag_name=>"button"}>?[0m
>  ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:30:in 
> `waitAndClickButton'?[0m
>
>
> On Tue, 6 Nov 2018 at 21:48, Titus Fortner  > wrote:
>
> This log is showing that the click was successful, but that the jquery 
> queue never empties. 
>
>
>
> On Tuesday, November 6, 2018 at 10:13:50 AM UTC-6, rajagopalan madasami 
> wrote:
>
> Hi Titus, 
>
> Here is the log 
>
> Testing started at 21:36 ... 
> C:\Ruby25\bin\ruby.exe C:\Ruby25\bin\rspec 
> C:/A/StringRay/Ruby_test_spec.rb 
> --require teamcity/spec/runner/formatter/teamcity/formatter --format 
> Spec::Runner::Formatter::TeamcityFormatter 
> C:/A/StringRay/InputFiles/Sanity1.xlsx 
> ["AGCSquoteCreation", "Test1", nil, nil] 
> nil 
> Test Starts in Latest Firefox 
> 2018-11-06 21:36:50 INFO Selenium -> POST 
> session/7e876088-d29b-4b08-90a2-6609870215df/url 
> 2018-11-06 21:36:50 INFO Selenium>>> 
> http://127.0.0.1:/session/7e876088-d29b-4b08-90a2-6609870215df/url | 
> {"url":"https://agcs-qa.maxprocessing.com/login.max?preprocess=true"} 
> 2018-11-06 21:37:44 INFO Selenium <- {"value":null} 
> Type  : User Name | testid 
> 2018-11-06 21:37:45 INFO Selenium -> POST 
> session/7e876088-d29b-4b08-90a2-6609870215df/element 
> 2018-11-06 21:37:45 INFO Selenium>>> 
> http://127.0.0.1:/session/7e876088-d29b-4b08-90a2-6609870215df/element 
> | {"using":"xpath","value":".//input[(not(@type) or 
> (translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"file\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"radio\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"checkbox\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"submit\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"reset\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"image\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"button\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"hidden\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"range\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"color\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"date\"
>  
>
> and 
> translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')!=\"datetime-local\"))
>  
>
> and @name='username']"} 
> 2018-11-06 21:37:45 INFO Selenium <- 
> {"value":{"element-6066-11e4-a52e-4f735466cecf":"319cbe67-1efa-4f24-a636-47d85834d4d8"}}
>  
>
> 2018-11-06 21:37:45 INFO Selenium -> GET 
> session/7e876088-d29b-4b08-90a2-6609870215df/element/319cbe67-1efa-4f24-a636-47d85834d4d8/enabled
>  
>
> 2018-11-06 21:37:45 INFO Selenium <- {"value":true} 
> 2018-11-06 21:37:45 INFO Selenium -> POST 
> session/7e876088-d29b-4b08-90a2-6609870215df/execute/sync 
> 2018-11-06 21:37:45 INFO Selenium>>> 
>
> http://127.0.0.1:/session/7e876088-d29b-4b08-90a2-6609870215df/execute/sync
>  
> | {"script":"return (function(){return function(){var d=this;function 
> f(a){return\"string\"==typeof a};function 
> h(a,b){this.code=a;this.a=l[a]||m;this.message=b||\"\";a=this.a.replace(/((?:^|\\s+)[a-z])/g,function(a){return
>  
>
> a.toUpperCase().replace(/^[\\s\\xa0]+/g,\"\")});b=a.length-5;if(0>b||a.indexOf(\"Error\",b)!=b)a+=\"Error\";
>  

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
Hi Titus, you there ?

On Tue 6 Nov, 2018, 9:50 PM Titus Fortner  What JS library is your  Angular/React/JQuery?
>
> On Tuesday, November 6, 2018 at 9:56:50 AM UTC-6, rajagopalan madasami
> wrote:
>>
>> Hi Titus,
>>
>> Here is I used waitAndclick method which uses b.element.click and then I
>> used waitAndClickButton method which uses b.button.click but both of them
>> are throwing the error.
>>
>> def waitAndClickButton(locator, action, name, data)
>>   puts "ClickButton   : #{name}"
>>   sleep 2
>>   loc = getLocator(locator)
>>   @b.button(loc.first => loc.last).click
>>   waitForPageLoad
>> end
>>
>> def waitForPageLoad
>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>> (jQuery.active === 0)").eql? true}
>> end
>>
>> You may ask why I put sleep 2, this is also another weird problem I am 
>> facing, program click the button and program successfully
>>
>> moves to the next line but application is not replicating that, Application 
>> is not receiving that click so it remains in the same page.
>>
>> Do you have any idea how to resolve this without using wait?
>>
>>
>> On Tue, 6 Nov 2018 at 21:17, Titus Fortner  wrote:
>>
>>> That's weird because it is failing in the wait_for_exists method, but
>>> the error message calls the inspect method which shows that it has been
>>> located. Can you share your waitAndClick method? I'd like to figure out how
>>> to reproduce this.
>>>
>>> Is it possible for the element to have gone stale? That could account
>>> for this discrepancy.
>>>
>>> If you turn on Selenium logging it would be obvious if it were polling
>>> for `enabled` and getting exceptions. `Selenium::WebDriver.logger.level =
>>> :info`
>>>
>>>
>>> On Tuesday, November 6, 2018 at 5:37:40 AM UTC-6, rajagopal...@gmail.com
>>> wrote:

 Hi Titus,

 I am facing weird problem,

 When I try to click the element, even after page arrives properly, it
 is waiting for 60 seconds and not clicking the button sometimes, it throws
 below error. but 4 out of 10 times it happens and rest of the time it runs
 successfully. What might be the problem? I never faced such a problem so
 far.


 Watir::Exception::UnknownObjectException: timed out after 60 seconds,
 waiting for #"NavContinue"}> to
 be located

   0) AGCSquoteCreation Test1
  ?[31mFailure/Error: raise unknown_exception, msg?[0m
  ?[31m?[0m
  ?[31mWatir::Exception::UnknownObjectException:?[0m
  ?[31m  timed out after 60 seconds, waiting for
 #"NavContinue"}> to be 
 located?[0m
  ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:15:in
 `waitAndClick'?[0m
  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block
 in execute'?[0m
  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in
 `each'?[0m
  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in
 `execute'?[0m
  ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in
 `call'?[0m
  ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in >>> (required)>'?[0m
  ?[36m# --?[0m
  ?[36m# --- Caused by: ---?[0m
  ?[36m# Watir::Wait::TimeoutError:?[0m
  ?[36m#   timed out after 60 seconds, waiting for true condition on
 #"NavContinue"}>?[0m
  ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:15:in
 `waitAndClick'?[0m

 --
>>> --
>>> 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-genera...@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-genera...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> --
> 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.
>

-- 
-- 
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

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
Hi, it's not JS error, its element not found error

Please look at here

*Watir::Exception::UnknownObjectException: timed out after 60 seconds,
waiting for #"NavContinue",
:tag_name=>"button"}> to be located*

  0) AGCSquoteCreation Test1
 ?[31mFailure/Error: raise unknown_exception, msg?[0m
 ?[31m?[0m
 ?[31mWatir::Exception::UnknownObjectException:?[0m
 ?[31m  timed out after 60 seconds, waiting for #"NavContinue", :tag_name=>"button"}> to be located?[0m
 ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:30:in
`waitAndClickButton'?[0m
 ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block in
execute'?[0m
 ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in `each'?[0m
 ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in
`execute'?[0m
 ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in
`call'?[0m
 ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in '?[0m
 ?[36m# --?[0m
 ?[36m# --- Caused by: ---?[0m
 ?[36m# Watir::Wait::TimeoutError:?[0m
 ?[36m#   timed out after 60 seconds, waiting for true condition on
#"NavContinue",
:tag_name=>"button"}>?[0m
 ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:30:in
`waitAndClickButton'?[0m


On Tue, 6 Nov 2018 at 21:50, Titus Fortner  wrote:

> What JS library is your  Angular/React/JQuery?
>
> On Tuesday, November 6, 2018 at 9:56:50 AM UTC-6, rajagopalan madasami
> wrote:
>>
>> Hi Titus,
>>
>> Here is I used waitAndclick method which uses b.element.click and then I
>> used waitAndClickButton method which uses b.button.click but both of them
>> are throwing the error.
>>
>> def waitAndClickButton(locator, action, name, data)
>>   puts "ClickButton   : #{name}"
>>   sleep 2
>>   loc = getLocator(locator)
>>   @b.button(loc.first => loc.last).click
>>   waitForPageLoad
>> end
>>
>> def waitForPageLoad
>>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
>> (jQuery.active === 0)").eql? true}
>> end
>>
>> You may ask why I put sleep 2, this is also another weird problem I am 
>> facing, program click the button and program successfully
>>
>> moves to the next line but application is not replicating that, Application 
>> is not receiving that click so it remains in the same page.
>>
>> Do you have any idea how to resolve this without using wait?
>>
>>
>> On Tue, 6 Nov 2018 at 21:17, Titus Fortner  wrote:
>>
>>> That's weird because it is failing in the wait_for_exists method, but
>>> the error message calls the inspect method which shows that it has been
>>> located. Can you share your waitAndClick method? I'd like to figure out how
>>> to reproduce this.
>>>
>>> Is it possible for the element to have gone stale? That could account
>>> for this discrepancy.
>>>
>>> If you turn on Selenium logging it would be obvious if it were polling
>>> for `enabled` and getting exceptions. `Selenium::WebDriver.logger.level =
>>> :info`
>>>
>>>
>>> On Tuesday, November 6, 2018 at 5:37:40 AM UTC-6, rajagopal...@gmail.com
>>> wrote:

 Hi Titus,

 I am facing weird problem,

 When I try to click the element, even after page arrives properly, it
 is waiting for 60 seconds and not clicking the button sometimes, it throws
 below error. but 4 out of 10 times it happens and rest of the time it runs
 successfully. What might be the problem? I never faced such a problem so
 far.


 Watir::Exception::UnknownObjectException: timed out after 60 seconds,
 waiting for #"NavContinue"}> to
 be located

   0) AGCSquoteCreation Test1
  ?[31mFailure/Error: raise unknown_exception, msg?[0m
  ?[31m?[0m
  ?[31mWatir::Exception::UnknownObjectException:?[0m
  ?[31m  timed out after 60 seconds, waiting for
 #"NavContinue"}> to be 
 located?[0m
  ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:15:in
 `waitAndClick'?[0m
  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block
 in execute'?[0m
  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in
 `each'?[0m
  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in
 `execute'?[0m
  ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in
 `call'?[0m
  ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in >>> (required)>'?[0m
  ?[36m# --?[0m
  ?[36m# --- Caused by: ---?[0m
  ?[36m# Watir::Wait::TimeoutError:?[0m
  ?[36m#   timed out after 60 seconds, waiting for true condition on
 #"NavContinue"}>?[0m
  ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:15:in
 `waitAndClick'?[0m

 --
>>> --
>>> 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
>>> 

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
What JS library is your  Angular/React/JQuery?

On Tuesday, November 6, 2018 at 9:56:50 AM UTC-6, rajagopalan madasami 
wrote:
>
> Hi Titus,
>
> Here is I used waitAndclick method which uses b.element.click and then I 
> used waitAndClickButton method which uses b.button.click but both of them 
> are throwing the error. 
>
> def waitAndClickButton(locator, action, name, data)
>   puts "ClickButton   : #{name}"
>   sleep 2
>   loc = getLocator(locator)
>   @b.button(loc.first => loc.last).click
>   waitForPageLoad
> end
>
> def waitForPageLoad
>   @b.wait_until(timeout: @Page_Load) {@b.execute_script("return 
> (jQuery.active === 0)").eql? true}
> end
>
> You may ask why I put sleep 2, this is also another weird problem I am 
> facing, program click the button and program successfully
>
> moves to the next line but application is not replicating that, Application 
> is not receiving that click so it remains in the same page. 
>
> Do you have any idea how to resolve this without using wait?
>
>
> On Tue, 6 Nov 2018 at 21:17, Titus Fortner  > wrote:
>
>> That's weird because it is failing in the wait_for_exists method, but the 
>> error message calls the inspect method which shows that it has been 
>> located. Can you share your waitAndClick method? I'd like to figure out how 
>> to reproduce this.
>>
>> Is it possible for the element to have gone stale? That could account for 
>> this discrepancy.
>>
>> If you turn on Selenium logging it would be obvious if it were polling 
>> for `enabled` and getting exceptions. `Selenium::WebDriver.logger.level = 
>> :info`
>>
>>
>> On Tuesday, November 6, 2018 at 5:37:40 AM UTC-6, rajagopal...@gmail.com 
>> wrote:
>>>
>>> Hi Titus,
>>>
>>> I am facing weird problem,
>>>
>>> When I try to click the element, even after page arrives properly, it is 
>>> waiting for 60 seconds and not clicking the button sometimes, it throws 
>>> below error. but 4 out of 10 times it happens and rest of the time it runs 
>>> successfully. What might be the problem? I never faced such a problem so 
>>> far. 
>>>
>>>
>>> Watir::Exception::UnknownObjectException: timed out after 60 seconds, 
>>> waiting for #"NavContinue"}> to 
>>> be located
>>>
>>>   0) AGCSquoteCreation Test1
>>>  ?[31mFailure/Error: raise unknown_exception, msg?[0m
>>>  ?[31m?[0m
>>>  ?[31mWatir::Exception::UnknownObjectException:?[0m
>>>  ?[31m  timed out after 60 seconds, waiting for 
>>> #"NavContinue"}> to be located?[0m
>>>  ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:15:in 
>>> `waitAndClick'?[0m
>>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block 
>>> in execute'?[0m
>>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in 
>>> `each'?[0m
>>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in 
>>> `execute'?[0m
>>>  ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in 
>>> `call'?[0m
>>>  ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in >> (required)>'?[0m
>>>  ?[36m# --?[0m
>>>  ?[36m# --- Caused by: ---?[0m
>>>  ?[36m# Watir::Wait::TimeoutError:?[0m
>>>  ?[36m#   timed out after 60 seconds, waiting for true condition on 
>>> #"NavContinue"}>?[0m
>>>  ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:15:in 
>>> `waitAndClick'?[0m
>>>
>>> -- 
>> -- 
>> 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-genera...@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-genera...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
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.


Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
But it's a lengthily program the line which has the problem may be at 30,
Is that okay? Do you want full log?

On Tue, 6 Nov 2018 at 21:26, Titus Fortner  wrote:

> I will need to see logging information to be able to help further.
>
>
>
> On Tuesday, November 6, 2018 at 9:49:32 AM UTC-6, rajagopal...@gmail.com
> wrote:
>>
>> Hi Titus,
>>
>> something goes terribly wrong while watir waits for element to exist.
>> Even after page loads completely, button clicks waits for 30 seconds and
>> reports me element doesn't exist. So I did this.
>>
>> begin
>> b.button(id: 'something').click
>> rescue
>> b.button(id: 'something').click
>> end
>>
>>
>> I put a debug pointer at the button click which comes in rescue so when
>> program enters into the rescue block, I execute by clicking F8 in RubyMine,
>> it works fine. So something terribly goes wrong in your waiting for element
>> to exist.
>>
>>
>>
>> --
> --
> 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.
>

-- 
-- 
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.


Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalan madasami
Hi Titus,

Here is I used waitAndclick method which uses b.element.click and then I
used waitAndClickButton method which uses b.button.click but both of them
are throwing the error.

def waitAndClickButton(locator, action, name, data)
  puts "ClickButton   : #{name}"
  sleep 2
  loc = getLocator(locator)
  @b.button(loc.first => loc.last).click
  waitForPageLoad
end

def waitForPageLoad
  @b.wait_until(timeout: @Page_Load) {@b.execute_script("return
(jQuery.active === 0)").eql? true}
end

You may ask why I put sleep 2, this is also another weird problem I am
facing, program click the button and program successfully

moves to the next line but application is not replicating that,
Application is not receiving that click so it remains in the same
page.

Do you have any idea how to resolve this without using wait?


On Tue, 6 Nov 2018 at 21:17, Titus Fortner  wrote:

> That's weird because it is failing in the wait_for_exists method, but the
> error message calls the inspect method which shows that it has been
> located. Can you share your waitAndClick method? I'd like to figure out how
> to reproduce this.
>
> Is it possible for the element to have gone stale? That could account for
> this discrepancy.
>
> If you turn on Selenium logging it would be obvious if it were polling for
> `enabled` and getting exceptions. `Selenium::WebDriver.logger.level = :info`
>
>
> On Tuesday, November 6, 2018 at 5:37:40 AM UTC-6, rajagopal...@gmail.com
> wrote:
>>
>> Hi Titus,
>>
>> I am facing weird problem,
>>
>> When I try to click the element, even after page arrives properly, it is
>> waiting for 60 seconds and not clicking the button sometimes, it throws
>> below error. but 4 out of 10 times it happens and rest of the time it runs
>> successfully. What might be the problem? I never faced such a problem so
>> far.
>>
>>
>> Watir::Exception::UnknownObjectException: timed out after 60 seconds,
>> waiting for #"NavContinue"}> to
>> be located
>>
>>   0) AGCSquoteCreation Test1
>>  ?[31mFailure/Error: raise unknown_exception, msg?[0m
>>  ?[31m?[0m
>>  ?[31mWatir::Exception::UnknownObjectException:?[0m
>>  ?[31m  timed out after 60 seconds, waiting for #> located: true; {:id=>"NavContinue"}> to be located?[0m
>>  ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:15:in
>> `waitAndClick'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block
>> in execute'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in
>> `each'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in
>> `execute'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in
>> `call'?[0m
>>  ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in > (required)>'?[0m
>>  ?[36m# --?[0m
>>  ?[36m# --- Caused by: ---?[0m
>>  ?[36m# Watir::Wait::TimeoutError:?[0m
>>  ?[36m#   timed out after 60 seconds, waiting for true condition on
>> #"NavContinue"}>?[0m
>>  ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:15:in
>> `waitAndClick'?[0m
>>
>> --
> --
> 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.
>

-- 
-- 
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.


[wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
I will need to see logging information to be able to help further.



On Tuesday, November 6, 2018 at 9:49:32 AM UTC-6, rajagopal...@gmail.com 
wrote:
>
> Hi Titus,
>
> something goes terribly wrong while watir waits for element to exist. Even 
> after page loads completely, button clicks waits for 30 seconds and reports 
> me element doesn't exist. So I did this.
>
> begin
> b.button(id: 'something').click
> rescue
> b.button(id: 'something').click
> end
>
>
> I put a debug pointer at the button click which comes in rescue so when 
> program enters into the rescue block, I execute by clicking F8 in RubyMine, 
> it works fine. So something terribly goes wrong in your waiting for element 
> to exist. 
>
>
>
>

-- 
-- 
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.


[wtr-general] Re: problem when locating the element

2018-11-06 Thread rajagopalanmadasami
Hi Titus,

something goes terribly wrong while watir waits for element to exist. Even 
after page loads completely, button clicks waits for 30 seconds and reports 
me element doesn't exist. So I did this.

begin
b.button(id: 'something').click
rescue
b.button(id: 'something').click
end


I put a debug pointer at the button click which comes in rescue so when 
program enters into the rescue block, I execute by clicking F8 in RubyMine, 
it works fine. So something terribly goes wrong in your waiting for element 
to exist. 



-- 
-- 
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.


[wtr-general] Re: problem when locating the element

2018-11-06 Thread Titus Fortner
That's weird because it is failing in the wait_for_exists method, but the 
error message calls the inspect method which shows that it has been 
located. Can you share your waitAndClick method? I'd like to figure out how 
to reproduce this.

Is it possible for the element to have gone stale? That could account for 
this discrepancy.

If you turn on Selenium logging it would be obvious if it were polling for 
`enabled` and getting exceptions. `Selenium::WebDriver.logger.level = :info`


On Tuesday, November 6, 2018 at 5:37:40 AM UTC-6, rajagopal...@gmail.com 
wrote:
>
> Hi Titus,
>
> I am facing weird problem,
>
> When I try to click the element, even after page arrives properly, it is 
> waiting for 60 seconds and not clicking the button sometimes, it throws 
> below error. but 4 out of 10 times it happens and rest of the time it runs 
> successfully. What might be the problem? I never faced such a problem so 
> far. 
>
>
> Watir::Exception::UnknownObjectException: timed out after 60 seconds, 
> waiting for #"NavContinue"}> to 
> be located
>
>   0) AGCSquoteCreation Test1
>  ?[31mFailure/Error: raise unknown_exception, msg?[0m
>  ?[31m?[0m
>  ?[31mWatir::Exception::UnknownObjectException:?[0m
>  ?[31m  timed out after 60 seconds, waiting for # located: true; {:id=>"NavContinue"}> to be located?[0m
>  ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:15:in 
> `waitAndClick'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block in 
> execute'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in `each'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in 
> `execute'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in 
> `call'?[0m
>  ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in  (required)>'?[0m
>  ?[36m# --?[0m
>  ?[36m# --- Caused by: ---?[0m
>  ?[36m# Watir::Wait::TimeoutError:?[0m
>  ?[36m#   timed out after 60 seconds, waiting for true condition on 
> #"NavContinue"}>?[0m
>  ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:15:in 
> `waitAndClick'?[0m
>
>

-- 
-- 
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.


Re: [wtr-general] problem when locating the element

2018-11-06 Thread rajagopalan madasami
Mine is not a loading problem program waits for 50 second after pages
loads.

On Tue 6 Nov, 2018, 5:24 PM Sharat Oommen  I have faced this issue earlier. What I could understand is it could be
> due to the network delays involved in loading the page sometimes. There are
> two ways to avoid this based on my understanding.
> 1)  Dynamic sleep:
> Something along the lines of this :
> def sleep_while_id_not_present(element_id, print_string)
> while !@browser.element(id: element_id).present? do
> puts "sleeping 1 sec, whilst #{print_string}"
> sleep 1
> end
> end
> Although Beware that this could cause race issues of its own. Be careful
> when using this.
> 2) You could get away using fire_event as it doesn't await confirmation.
> read here: fire_event
> 
> Hope this helps!
>
> Regards,
> Sharat Oommen
> On Tue, 6 Nov 2018 at 17:07,  wrote:
>
>> Hi Titus,
>>
>> I am facing weird problem,
>>
>> When I try to click the element, even after page arrives properly, it is
>> waiting for 60 seconds and not clicking the button sometimes, it throws
>> below error. but 4 out of 10 times it happens and rest of the time it runs
>> successfully. What might be the problem? I never faced such a problem so
>> far.
>>
>>
>> Watir::Exception::UnknownObjectException: timed out after 60 seconds,
>> waiting for #"NavContinue"}> to
>> be located
>>
>>   0) AGCSquoteCreation Test1
>>  ?[31mFailure/Error: raise unknown_exception, msg?[0m
>>  ?[31m?[0m
>>  ?[31mWatir::Exception::UnknownObjectException:?[0m
>>  ?[31m  timed out after 60 seconds, waiting for #> located: true; {:id=>"NavContinue"}> to be located?[0m
>>  ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:15:in
>> `waitAndClick'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block
>> in execute'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in
>> `each'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in
>> `execute'?[0m
>>  ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in
>> `call'?[0m
>>  ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in > (required)>'?[0m
>>  ?[36m# --?[0m
>>  ?[36m# --- Caused by: ---?[0m
>>  ?[36m# Watir::Wait::TimeoutError:?[0m
>>  ?[36m#   timed out after 60 seconds, waiting for true condition on
>> #"NavContinue"}>?[0m
>>  ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:15:in
>> `waitAndClick'?[0m
>>
>> --
>> --
>> 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.
>>
> --
> --
> 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.
>

-- 
-- 
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.


Re: [wtr-general] problem when locating the element

2018-11-06 Thread Sharat Oommen
I have faced this issue earlier. What I could understand is it could be due
to the network delays involved in loading the page sometimes. There are two
ways to avoid this based on my understanding.
1)  Dynamic sleep:
Something along the lines of this :
def sleep_while_id_not_present(element_id, print_string)
while !@browser.element(id: element_id).present? do
puts "sleeping 1 sec, whilst #{print_string}"
sleep 1
end
end
Although Beware that this could cause race issues of its own. Be careful
when using this.
2) You could get away using fire_event as it doesn't await confirmation.
read here: fire_event

Hope this helps!

Regards,
Sharat Oommen
On Tue, 6 Nov 2018 at 17:07,  wrote:

> Hi Titus,
>
> I am facing weird problem,
>
> When I try to click the element, even after page arrives properly, it is
> waiting for 60 seconds and not clicking the button sometimes, it throws
> below error. but 4 out of 10 times it happens and rest of the time it runs
> successfully. What might be the problem? I never faced such a problem so
> far.
>
>
> Watir::Exception::UnknownObjectException: timed out after 60 seconds,
> waiting for #"NavContinue"}> to
> be located
>
>   0) AGCSquoteCreation Test1
>  ?[31mFailure/Error: raise unknown_exception, msg?[0m
>  ?[31m?[0m
>  ?[31mWatir::Exception::UnknownObjectException:?[0m
>  ?[31m  timed out after 60 seconds, waiting for # located: true; {:id=>"NavContinue"}> to be located?[0m
>  ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:15:in
> `waitAndClick'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block in
> execute'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in `each'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in
> `execute'?[0m
>  ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in
> `call'?[0m
>  ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in  (required)>'?[0m
>  ?[36m# --?[0m
>  ?[36m# --- Caused by: ---?[0m
>  ?[36m# Watir::Wait::TimeoutError:?[0m
>  ?[36m#   timed out after 60 seconds, waiting for true condition on
> #"NavContinue"}>?[0m
>  ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:15:in
> `waitAndClick'?[0m
>
> --
> --
> 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.
>

-- 
-- 
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.


[wtr-general] problem when locating the element

2018-11-06 Thread rajagopalanmadasami
Hi Titus,

I am facing weird problem,

When I try to click the element, even after page arrives properly, it is 
waiting for 60 seconds and not clicking the button sometimes, it throws 
below error. but 4 out of 10 times it happens and rest of the time it runs 
successfully. What might be the problem? I never faced such a problem so 
far. 


Watir::Exception::UnknownObjectException: timed out after 60 seconds, 
waiting for #"NavContinue"}> to 
be located

  0) AGCSquoteCreation Test1
 ?[31mFailure/Error: raise unknown_exception, msg?[0m
 ?[31m?[0m
 ?[31mWatir::Exception::UnknownObjectException:?[0m
 ?[31m  timed out after 60 seconds, waiting for #"NavContinue"}> to be located?[0m
 ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:15:in 
`waitAndClick'?[0m
 ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block in 
execute'?[0m
 ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in `each'?[0m
 ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in 
`execute'?[0m
 ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in 
`call'?[0m
 ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in '?[0m
 ?[36m# --?[0m
 ?[36m# --- Caused by: ---?[0m
 ?[36m# Watir::Wait::TimeoutError:?[0m
 ?[36m#   timed out after 60 seconds, waiting for true condition on 
#"NavContinue"}>?[0m
 ?[36m#   ./Source/FrameWorkModules/Elements/Button.rb:15:in 
`waitAndClick'?[0m

-- 
-- 
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.