i'm testing a silverlight application, that pops up when the browser closes, at the end of the test.
This dialog asks if I want to stay or leave the page.
When I record the test, that dialog was recorded as a OnBeforeUnload dialog, and a handler was put as a step. But, when running the test, it fails on that step
i disabled this recorded step, and added a new one, manually through the dialogs menu, but the result was the same.
in order to workaround this issue, I created a code step, and put inside of it the following code:
My question is, shouldn't that onbeforeUnload Handler work, instead of have to create a new code step with those two lines?
7 Answers, 1 is accepted
I am sorry to hear you are experiencing this behavior. Well done on finding a workaround for this problem. The recorded step itself should work and in order to investigate this further we might need access to the dialog in question if possible. You can also try increasing the HandleTimeout value a bit more.
There is another value I would like you to increase a bit - Initialization Time (refer to the screenshot attached) - this is not a timeout but rather a delay that happens right before the handling of the dialog begins. The idea is to give the browsers some time to show the notification bar. You could also try to increase this one. The default is 250 milliseconds.
Reserve your seat today!
I did what you have recommended, increased HandleTimeout and the Initialization Time, but but the issue still continues.
I've also enabled the UseStepWaitOnElements at the same time that increased the timeouts, and with default timeouts, but with no success.
The only solution that hands that dialog window, is that workaround that I've made.
In order to investigate this further we will need a sample test reproducing this behavior. Is it possible for you to provide us with a sample test which we can execute locally and investigate further?
Another approach will be if you try to download our Test Studio R1 beta release, install it on a separate machine and check if the recorded step is working fine. Please note that since this is a beta version I strongly recommend you not to use it production. The beta will not require licensing so installing it on a different machine will not be a problem. If you decide to proceed that way please refer to the download link provided in my signature.
Thank you for your cooperation in advance.
I have installed Test Studio R1 beta release, but the behavior was the same that in 2012.2.1420.0 - only my workaround works.
In attach is a sample test and a .xml data source that I'm using.
You can't execute this test - it will not run, but you can create another one based on this to run in your environment.
Thank you for providing me with the test. You are right that I am not able to run the test, but using the beta version of our R1 release I have created sample test and I was not able to reproduce this behavior, it is working as expected as you can see from this video.
I've also attached the test I am using for your further references, you can execute it on your side since it is public available demo for OnBeforeUnload.
The sample test in attach ran smoothly.
Apparently this site behaves like my testing site, so I'll keep doing some tests on my site to see if I find out why this handler isn't working.
Thank you for your feedback.
You are most welcome, yes it seems like specific issue on your side. If you manage to provide access so we can reproduce this locally we can investigate further.Regards,