I am having trouble with a test that works with an IE modal pop-up window. The test finds the window no problem, can fill in fields on the window without any issue, but gets confused when the window is closed - it can no longer interact with the main window. As part of the test, a button is clicked in the application which closes the window.
I have tried commenting out the Terlik "close modal pop-up window" step, looks like that step is trying to close the window which is already closed.
I have also set the "closes browser" to true for the test step which clicks the button to close window. This looked promising, but didn't seem to have an effect - also interesting, I would have expected this to change the generated coded step, but didn't notice anything change with and without this set.
I have tried commenting out the Terlik "close modal pop-up window" step, looks like that step is trying to close the window which is already closed.
I have also set the "closes browser" to true for the test step which clicks the button to close window. This looked promising, but didn't seem to have an effect - also interesting, I would have expected this to change the generated coded step, but didn't notice anything change with and without this set.
5 Answers, 1 is accepted
0
Hello David,
The problem is that when you are closing a Modal Popup with a click step, the click step is closing the Modal Popup, but the ActiveBrowser is still pointing to the popup which no longer exists.
Due to a known issue with this scenario, use the following work-around:
All the best,
Plamen
the Telerik team
The problem is that when you are closing a Modal Popup with a click step, the click step is closing the Modal Popup, but the ActiveBrowser is still pointing to the popup which no longer exists.
Due to a known issue with this scenario, use the following work-around:
- Convert the Close Modal step to code. It should read: ActiveBrowser.Close();
- Even though the Modal is already closed, this code will properly return focus to the parent window and allow execution to continue.
All the best,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Test Studio Trainings
0
David
Top achievements
Rank 1
answered on 16 Jul 2012, 12:45 PM
Thanks Plamen -
That does help, but there is still something off in the scenario. If I use the coded step to close the window, the events in my window are not firing and so I don't end up in the right place in my application. When I use the "Click" method on the HTML button in the modal dialog, I get the desired behavior in my application, but Telerik fails with an error that looks like it is waiting for the browser to be ready (it never finishes the click method so I can't get to my coded step). I can't seem to get around this - if I use the MouseClick method, the window closes, but my application isn't ending on the correct screen. If I use the click and choose the 'closes the browser' option, again my application doesn't end on the correct screen.
Very confusing. Any suggestions?
That does help, but there is still something off in the scenario. If I use the coded step to close the window, the events in my window are not firing and so I don't end up in the right place in my application. When I use the "Click" method on the HTML button in the modal dialog, I get the desired behavior in my application, but Telerik fails with an error that looks like it is waiting for the browser to be ready (it never finishes the click method so I can't get to my coded step). I can't seem to get around this - if I use the MouseClick method, the window closes, but my application isn't ending on the correct screen. If I use the click and choose the 'closes the browser' option, again my application doesn't end on the correct screen.
Very confusing. Any suggestions?
0
Hi David,
I am sorry I wasn't clear enough. You need to keep them both the recorded Click step and the coded step. The coded step(ActiveBrowser.Close();) should be right after the Click step and the SimulateRealClick property for the Click step should be set to True(i.e. MouseClick() instead Click()). Thereby the Click will fire the required events and the coded step will return the focus to the parent window.
Regards,
Plamen
the Telerik team
I am sorry I wasn't clear enough. You need to keep them both the recorded Click step and the coded step. The coded step(ActiveBrowser.Close();) should be right after the Click step and the SimulateRealClick property for the Click step should be set to True(i.e. MouseClick() instead Click()). Thereby the Click will fire the required events and the coded step will return the focus to the parent window.
Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Test Studio Trainings
0
Pranay
Top achievements
Rank 1
answered on 10 Dec 2012, 03:15 PM
Hi,
I have a requirement where there is a button in Modal dialog say "create". When the user clicks on "create", Modal dialog should be closed and he should be Navigated to a form (i.e. it should set the focus to some new frame created after clicking on create).
I tried the Manual Coded step ActiveBrowser.Close() in Close Modal pop-up window step and as suggested in discussion I have Set ClosesBrowser to true for create button.But after doing this it is navigating me to Parent window and Not to the form which is generated after clicking create.
So Is there any way to resolve it.
Thanks
Pranay
I have a requirement where there is a button in Modal dialog say "create". When the user clicks on "create", Modal dialog should be closed and he should be Navigated to a form (i.e. it should set the focus to some new frame created after clicking on create).
I tried the Manual Coded step ActiveBrowser.Close() in Close Modal pop-up window step and as suggested in discussion I have Set ClosesBrowser to true for create button.But after doing this it is navigating me to Parent window and Not to the form which is generated after clicking create.
So Is there any way to resolve it.
Thanks
Pranay
0
Hello Pranay,
I am sorry to hear you are experiencing this problem. You stated "after doing this it is navigating me to Parent window and Not to the form which is generated after clicking create", so my question is when the focus is on the Parent window, does the generated form is still opened? If it is, please try using the following code right after ActiveBrowser.Close():
This should set the focus to the generated form.
If the form and the modal window are both closed and the focus is on the Parent window, try to remove the ActiveBrowser.Close() method and use only the code above.
If you continue to have difficulty, we'll need to reproduce the issue locally in order to find a workable solution for you. Please provide us with a copy of your test and access to your application. If it is not possible to grant us access to your application, please take a Fiddler trace using FiddlerCap and send it to us in a zip file. A Jing video demonstrating the issue may also help us to better understand what is happening. If you deem that information too sensitive for this forum, you can create a support ticket and attach it there. Thanks for providing the information we need to best assist you.
Regards,
Plamen
the Telerik team
I am sorry to hear you are experiencing this problem. You stated "after doing this it is navigating me to Parent window and Not to the form which is generated after clicking create", so my question is when the focus is on the Parent window, does the generated form is still opened? If it is, please try using the following code right after ActiveBrowser.Close():
Manager.Browsers[1].Window.SetFocus();
This should set the focus to the generated form.
If the form and the modal window are both closed and the focus is on the Parent window, try to remove the ActiveBrowser.Close() method and use only the code above.
If you continue to have difficulty, we'll need to reproduce the issue locally in order to find a workable solution for you. Please provide us with a copy of your test and access to your application. If it is not possible to grant us access to your application, please take a Fiddler trace using FiddlerCap and send it to us in a zip file. A Jing video demonstrating the issue may also help us to better understand what is happening. If you deem that information too sensitive for this forum, you can create a support ticket and attach it there. Thanks for providing the information we need to best assist you.
Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Test Studio Trainings