SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Sep 2009
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to wait for all objects on page to load?

    I am new to SilkTest, and working to setup a test case for a web application (SAP IC Web client).
    I have a problem with test script looking for/clicking on an object, before it actually finishes loading. If I use Sleep(60) and wait for that long, then it completes the load and it is able to move on successfully, but I cannot use sleep, as the time it takes for the page to load completely is one of the timer metrics I need to collect.
    Can someone recommend other ways to make sure that all objects on the page completely loads before it moves forward with next command?

    On SilkTest 2008 R2 SP1 (Version 9.2.1.2600).

    Thanks in advance!

  2. #2
    Member
    Join Date
    Sep 2006
    Posts
    204
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to wait for all objects on page to load?

    You wait for object which is common in all windows( For. E.g Header, Footer). If it doesn't work check if the parent window which is defined in your application exists and wait till that object exists.

  3. #3
    Member
    Join Date
    Oct 2008
    Location
    Hyderabad, India
    Posts
    59
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to wait for all objects on page to load?

    instead of for all objects you can wait for required object to save the test case execution time. for this use exists method instead of sleep method.
    e.g : if(myobject.exists(60))
    myobject.click()
    refer to silktest help for more details on exists method.

    -Keshav

  4. #4
    Junior Member
    Join Date
    Sep 2009
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to wait for all objects on page to load?

    Thanks voks and keshavreddy.
    I will try suggested when I get back and update.

    Thanks again.

  5. #5
    Member
    Join Date
    Jun 2007
    Posts
    79
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to wait for all objects on page to load?

    while !Object.Exists()
    sleep(1)

  6. #6
    Junior Member
    Join Date
    Sep 2009
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to wait for all objects on page to load?

    actually, Agent must wait itself while browser page is fully loaded but if it don't, use

    Browser.WaitForReady()
    Good defeats evil. Veeery evil.

  7. #7
    Junior Member
    Join Date
    Sep 2009
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to wait for all objects on page to load?

    How can I use

    while !Object.Exists()
    sleep(1)

    but have it still timeout after a while? Putting a value inside Exists(60) seems to make each check within the while 60 seconds, but still loops since it is part of the while.

  8. #8
    Junior Member
    Join Date
    Sep 2009
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to wait for all objects on page to load?

    Thanks for everyone's help.
    I was able to successfully setup the testcase (my first one!).
    Much appreciated!

  9. #9
    Junior Member
    Join Date
    Sep 2008
    Location
    Bengaluru, Karnataka
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to wait for all objects on page to load?

    Just a thought:
    You can use agent options -- like
    Agent.SetOption(OPT_VERIFY_APPREADY, TRUE)

    This will make silk test to wait till all the objects are loaded and then it will execute the next line of code.
    This is better than using sleep ()
    ------------
    Ravindra

    "If you have the inclination, you have the time"

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 8.82%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:25 AM.

Copyright BetaSoft Inc.