Anyone else have this problem? and maybe a solution? :P
Here is the code:
var dialog =
new
DownloadDialogsHandler(
Global.MANAGER.ActiveBrowser,
(String.IsNullOrWhiteSpace(filePath) ? DialogButton.CANCEL : DialogButton.SAVE),
(String.IsNullOrWhiteSpace(filePath) ? String.Empty : Global.GetPath(filePath)),
Global.MANAGER.Desktop
);
try
{
downloadControl.Click();
Global.MANAGER.ActiveBrowser.WaitUntilReady();
dialog.WaitUntilHandled(timeout);
}
catch
(TimeoutException) {}
finally
{}
10 Answers, 1 is accepted
I am not able to reproduce this problem using your code. Which version of IE are you using? Test Studio is supposed to automatically detect the Download Complete dialog and close it for you. In fact the presence of this dialog is what lets Test Studio know it has finished.
Can you record a video of this problem happening on your machine? Watching the video I might be able to spot where it's going wrong. Jing is a good and free screen recorder.
Cody
the Telerik team
Test Studio Trainings
Sorry for the huge delay on responding. As we made some significant changes to our test infrastructure this issue was put on the back burner.
We seem to be having this issue across a lot of IE versions when run inside a VM. My thoughts are that it could be a setting issue. I'm still using the same code that I originally posted. I have created a Jing video for you, (feel free to ignore everything before the first minute, that is the method I used for testing our tests on a VM).
http://screencast.com/t/nlbABGOa0Z
As you will see in the video it clicks the download link, the download dialogue opens, and just sits there. I set the delays to be massive but eventually it fails with a timeout exception.
If you could give me some insights on how I could fix this that would be marvelous!
Thanks
Jon
I can't seem to figure out why this works, at first I thought it was because there is a full post back to get the correct file. I tried a wait for URL and it didn't work. Hopefully you guys can shed some light on this issue for me.
Cheers
Jon
I cannot explain why adding an Execution Delay would help. I did just notice something about your code (I should have spotted this earlier). I would like you to comment out this line:
Global.MANAGER.ActiveBrowser.WaitUntilReady();
It actually may be interfering with the dialog.WaitUntilHandled.
If that doesn't help I'd like to look at this problem via GoToMeeting.
Cody
the Telerik team
Test Studio Trainings
Unfortunately that didn't seem to do the trick.
I'm available all day today, and friday.
Cheers
Jon
jon[at]scorpionsoft.com
I see. How about 3pm CDT today?
1. Please join my meeting, Wednesday, March 20, 2013 at 3:00 PM Central Daylight Time.
https://www2.gotomeeting.com/join/600236026
2. Use your microphone and speakers (VoIP) - a headset is recommended. Or, call in using your telephone.
Dial +1 (267) 507-0012
Access Code: 600-236-026
Audio PIN: Shown after joining the meeting
Meeting ID: 600-236-026
Cody
the Telerik team
Test Studio Trainings
Thanks
Jon
Just to summarize the outcome of our meeting... I noticed that your application is using an "accordion" type of control on the web page. It's important that the test script synchronize with the accordion finishing it's animation before moving to the next step of the test. This explains why the script runs fine on your local fast machine (it may even be intermittent on that machine) and only work with a fixed 5 second delay on the slower VM.
You were going to investigate how to synchronize with this animation. Maybe there's an event handler you can hook into that indicates the animation is finished. Let us know what (if anything) you come up with.
I am closing this ticket for now. You can reopen it in the future if/when appropriate.
Cody
the Telerik team
Test Studio Trainings
After further investigation, I've found that the rendering speed on IE9 is not very good. I've found a javascript event listener that will notify me when the animation is complete (attached below). Though I'm not sure how I'm going to figure out a way to pass this event back to the C# code so that I can notify the tests to continue. If you have any ideas on how I can create a callback to my code that would be great.
Thanks again for spending the time with me today! It was a pleasure!
Cheers
Jon
$(
".selector"
).on(
"accordionactivate"
,
function
( event, ui ) {} );
/* http://api.jqueryui.com/accordion/ */
Yes we have a method of activating .NET event handlers from JavaScript events. Look in the section JavaScript Event Handlers on this page. Let me know how it goes.
Greetings,Cody
the Telerik team
Test Studio Trainings