Active Topics Memberlist Calendar Search Help | |
Register Login |
One Stop Testing Forum : Testing Tools @ OneStopTesting : SilkTest @ OneStopTesting |
Topic: Wait property in Silk |
|
Author | Message |
ritu
Newbie Joined: 24Apr2007 Online Status: Offline Posts: 1 |
Topic: Wait property in Silk Posted: 24Apr2007 at 9:45pm |
How to use the wait method in Silk test? iam suppose to test a web page
but it so happens like silk test doesn't wait for the page to be
loaded, so how to overcome this problem?
Post Resume: Click here to Upload your Resume & Apply for Jobs |
|
IP Logged | |
suvam
Newbie Joined: 25Apr2007 Online Status: Offline Posts: 1 |
Posted: 25Apr2007 at 1:58am |
You might also want to build your own function as there are times when SilkTest thinks the
page is done loading and it isn't really. Code: [+] BOOLEAN WaitFor (WINDOW wObject, REAL rTimeout optional) [ ] BOOLEAN bRtn [ ] HANDLE hTimer [ ] [ ] // if the timeout interval hasn't been specified [+] if (rTimeout == NULL) [ ] [ ] // set it to whatever the agent value is [ ] rTimeout = Agent.GetOption (OPT_WINDOW_TIMEOUT) [ ] [ ] // create a timer [ ] hTimer = TimerCreate () [ ] [ ] // start the timer [ ] TimerStart (hTimer) [ ] [ ] // so long as the object isn't here [+] while (wObject.Exists () == FALSE) [ ] [ ] // if we've exceeded the timeout value [+] if (TimerValue (hTimer) > rTimeout) [ ] [ ] // break out of the loop [ ] break [ ] [ ] [ ] [ ] // nuke the timer [ ] TimerStop (hTimer) [ ] TimerDestroy (hTimer) [ ] [ ] // if the object STILL doesn't exist [+] if (wObject.Exists () == FALSE) [ ] [ ] // set the return value to false (in case they're trapping) [ ] bRtn = FALSE [ ] [ ] // // raise an error (can be trapped with a do...except back in the calling function/method [ ] // raise 1, "*** Error: Timed out waiting for {wObject}" [ ] [+] else [ ] bRtn = TRUE [ ] [ ] [ ] [ ] // and we're outa here [ ] return bRtn |
|
IP Logged | |
Forum Jump |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
© Vyom Technosoft Pvt. Ltd. All Rights Reserved.