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

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

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

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

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

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

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

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

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

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

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 >

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

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

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

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.

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)

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:

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

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,

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

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

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

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

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

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

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

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

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

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:

[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

[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

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

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,

[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

[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

[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

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 =

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,

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 >