Forum Discussion
9 Replies
- irina_lukinaSuper ContributorI'm glad it helped :)
- VLapidusFrequent Contributor
- anandkumarContributorHi Ncoes
thanks for ur reply. prob is i cant put a check on time after each and every statement. so how can i handle this to monitor the execution every second. - irina_lukinaSuper Contributor
Hi Amand,
I recommend that you create a test item and assign your script to this test item. After that, you can set the maximum execution time (in minutes) for the created test item. For this purpose, use the Timeout column of the Test Items page.
For more information on the described approach, please refer to the Terminating Tests on Timeout help topic. I hope this information helps :)
- anandkumarContributorHi Irina
Thanks for ur reply. i bit confused using it. i set the test item timeout to 1min. but still it keeps on running after 1min also. how to call the ontimeout method? if u have an example for that can u plz post it. it would be of great helpful. - irina_lukinaSuper Contributor
Hi Anand,
As the Terminating Tests on Timeout help topic states, you need to do this:
1. Set the needed test item's timeout on the Test Items page.
2. Add the OnTimeout event to the Event controls. For more information, see the Adding Events to Event Controls help topic.
3. Specify the following handler for the added event:
function GeneralEvents_OnTimeout(Sender, Params)
{
Runner.Stop(true);
}
Does this help? - anandkumarContributorHi Irina,
Thanks for ur reply. yes i did as u mentioned.
-set the timeout to be 1min for the test item
-added ontimeout event handler
and following is the code i used to test it
Sub GeneralEvents_OnTimeout(Sender, Params)
Runner.Stop
End Sub
sub test
delay 70000
msgbox "hai"
end sub
but when i run this 'test' routine its not going to the ontimeout handler at all. just keeps on executing more than 1min. how to make it perfect? - irina_lukinaSuper Contributor
Hi Amand,
but when i run this 'test' routine its not going to the ontimeout handler at all
I guess, I know what is wrong :) . To rise the OnTimeout event, you need to add the Test routine to the Test Items page, and then run the entire project, but not the routine. For this purpose, right-click the project node in the Project Explorer panel and select Run from the ensuing context menu.Does it work now?
- anandkumarContributorHi Irina,
yes it helped and its of great help to me.
Thank u very much :)