
Jinesh Kurian
Top achievements
Rank 1
Jinesh Kurian
asked on 17 May 2010, 03:52 PM
I've recorded a scenario and it was working fine. But now, the application has undergone some changes and its a pretty slow. So the testcase fails all the time. Is there any way to control the speed of execution of the scenarions in Telerik? As of now, I'm adding Sleep in between, but its not the right way. I dont want my testcase to undergo changes frequently.
Please suggest me a good way to do this.
Please suggest me a good way to do this.
3 Answers, 1 is accepted
0
Hi Jinesh Kurian,
In cases like these there are a few things you can do:
All the best,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
In cases like these there are a few things you can do:
- Increase the "WaitOnElementsTimeout" property of the test steps giving you a problem. This is the amount of time the test step will wait for the element to exist before acting on it (e.g. clicking on a button or typeing text into an input field). The default is 5000 milliseconds (5 seconds). Increase this to however long you need.
- Change you Verification steps into a "Wait for" step. The step will perform the same sort of verification but it will wait up to the Timeout property in the Wait group for the test to be true instead of failing immediately.
- When the above two are not sufficient, you can add a "Wait for element exists" step. These are especially important for AJAX postback calls. For example, you have a web page that takes 30 seconds to appear, find an element on that web page, turn on highlighting, open the Element Menu for that element, click the Quick Tasks button, double click Wait For Exists. That will add a Wait For Exists step for that element. Then change the timeout property of that step to something like 60 seconds.
Let me know if I can of further assistance on this.
All the best,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0

Jinesh Kurian
Top achievements
Rank 1
answered on 18 May 2010, 06:15 AM
Cody,
This is how I've used sleep in my code. After typing "A MGR" and pressing Enter, it takes some time for the application to load a window. This window will load in 5 seconds. So i've added a sleep of 5 seconds. But now the application has become a little slower. So I need to increase the sleep time to, say 7 seconds. My question is, is there any way to synchronize whats happening on the page to the execution of the test case. I'm using a pure Silverlight application.
This is how I've used sleep in my code. After typing "A MGR" and pressing Enter, it takes some time for the application to load a window. This window will load in 5 seconds. So i've added a sleep of 5 seconds. But now the application has become a little slower. So I need to increase the sleep time to, say 7 seconds. My question is, is there any way to synchronize whats happening on the page to the execution of the test case. I'm using a pure Silverlight application.
_Pages.AccountScreen.SilverlightApp.PARTEditableTextBoxPickertextbox.Text = ""; |
_Pages.AccountScreen.SilverlightApp.PARTEditableTextBoxPickertextbox.User.TypeText("A MGR", 10); |
_ActiveBrowser.Manager.Desktop.KeyBoard.KeyPress(ArtOfTest.WebAii.Win32.KeyBoard.KeysFromString("Enter"), 150, 1); |
System.Threading.Thread.Sleep(5000); |
_ActiveBrowser.Manager.Desktop.KeyBoard.KeyPress(ArtOfTest.WebAii.Win32.KeyBoard.KeysFromString("Tab"), 150, 2); |
_ActiveBrowser.Manager.Desktop.KeyBoard.KeyPress(ArtOfTest.WebAii.Win32.KeyBoard.KeysFromString("Ctrl+A"), 150, 1); |
_Pages.AccountScreen.SilverlightApp.PARTEditableTextBoxPickertextbox.User.TypeText("Request Manager Review", 10); |
0
Hello Jinesh Kurian,
Yes, in this case you case you need the third approach I spoke of in my last reply. What elements appear on this new window after your 7 second delay? What you need to do is to add a WaitFor Exists for one of these elements.
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Yes, in this case you case you need the third approach I spoke of in my last reply. What elements appear on this new window after your 7 second delay? What you need to do is to add a WaitFor Exists for one of these elements.
- Launch the recorder
- Pause recording
- Navigate your website until you get to this page that takes 7 seconds to load
- Turn on Highlighting
- Highlight any element on this page
- Click on the blue circle to open the Elements menu
- Click the Add to project button
- Now in code add a Wait.ForExists line like this that replaces your Sleep line:
_Pages.AccountScreen.SilverlightApp.Item5Image.Wait.ForExists(10000);
In this sample, Item5Image is the name of the element I choose to wait for as it appears in Elements Explorer. Substitute the name of your element you choose from your page.
Regards,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.