Active TopicsActive Topics  Display List of Forum MembersMemberlist  CalendarCalendar  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin


 One Stop Testing ForumTesting Tools @ OneStopTestingSilkTest @ OneStopTesting

Message Icon Topic: Wait property in Silk

Post Reply Post New Topic
Author Message
ritu
Newbie
Newbie
Avatar

Joined: 24Apr2007
Online Status: Offline
Posts: 1
Quote ritu Replybullet 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 IP Logged
suvam
Newbie
Newbie
Avatar

Joined: 25Apr2007
Online Status: Offline
Posts: 1
Quote suvam Replybullet 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 IP Logged
Post Reply Post New Topic
Printable version Printable version

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



This page was generated in 0.406 seconds.
Vyom is an ISO 9001:2000 Certified Organization

© Vyom Technosoft Pvt. Ltd. All Rights Reserved.

Privacy Policy | Terms and Conditions
Job Interview Questions | Placement Papers | Free SMS | Freshers Jobs | MBA Forum | Learn SAP | Web Hosting