SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Aug 2007
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    how to calculate pageload without Sync property

    Set loginPage = Browser("name:=" & browser_splash_title).Page
    ("title:=" & browser_splash_title)
    loginPage.Sync
    loginPage.WebEdit("html id:=username").Set username
    loginPage.WebEdit("html id:=password").Set password
    wait 0,300
    'Dim homesTime,homeeTime,homeTotTime
    loginPage.WebElement("html id:=loginBtn_label").Click
    homesTime=Timer
    Browser("Home_CaretTalks_Site").Page("Home_Page"). Sync
    homeeTime=Timer
    homeTotTime=round(homeeTime-homesTime)
    Print homeTotTime
    most of the times it displays some thing like 120 or 122 seconds but
    when i do it manually to load that page it will not take more than 5
    seconds. Do you guys have any idea ? or is there any other way to
    calculate page loading time instead of Sync property.

  2. #2
    Member
    Join Date
    Oct 2003
    Location
    Norfolk, VA
    Posts
    360
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to calculate pageload without Sync property

    Here's what I've used with success:
    <font class="small">Code:</font><hr /><pre>
    Extern.Declare micDWord, "GetTickCount", "kernel32.dll", "GetTickCount",micLong
    WebUtil.DeleteCookies
    Systemutil.Run "iexplore.exe"
    Browser("B").Page("P").Sync
    start = Extern.GetTickCount(any)
    Browser("B").Navigate "www.sqaforums.com"
    Browser("B").Page("P").sync
    scriptend = Extern.GetTickCount(any)
    this = cstr(clng(scriptend) - clng(start))
    Msgbox "Load Time = "&amp;this&amp;" msecs"
    </pre><hr />
    A good rule of thumb is to never measure with your thumb.

  3. #3
    Junior Member
    Join Date
    Aug 2007
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to calculate pageload without Sync propert

    Thanks for your code .

    But is it possible to calculate total page load without using Sync at the end of page.

  4. #4
    Member
    Join Date
    Oct 2003
    Location
    Norfolk, VA
    Posts
    360
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to calculate pageload without Sync propert

    Do you have an aversion to Sync? An alternative is to use ReadyState (don't use the ROProperty, for some reason it doesn't report correctly)
    myState = Browser("B").Page("P").Object.ReadyState

    myState should = "complete" when page is loaded use do until logic:
    do until myState = "complete"
    myState = Browser("B").Page("P").Object.ReadyState
    loop

    There are some caveats using this; if the page doesn't exist you will get an error, if the page doesn't load for some reason, the script will be stuck in the loop.
    A good rule of thumb is to never measure with your thumb.

  5. #5
    Apprentice
    Join Date
    Dec 2008
    Posts
    38
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to calculate pageload without Sync propert

    Hi SteveK,

    Can you explain how below statement will capture time?
    start = Extern.GetTickCount(any)..

  6. #6
    Junior Member
    Join Date
    Aug 2007
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to calculate pageload without Sync propert

    hi SteveK

    Thanks for your code. it is working fine for me. only thing i can use sync but my tech manager do not want me to use sync property. Anyway thanks for your code. it is serving my problem.

    Thanks
    RM

  7. #7
    Junior Member
    Join Date
    Aug 2007
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to calculate pageload without Sync propert

    Hi QAAUT123

    have look at this below article about

    http://en.wikipedia.org/wiki/GetTickCount
    it is inbuilt windows function to calculate the time in milliseconds.

    Thanks
    RM

  8. #8
    Apprentice
    Join Date
    Dec 2008
    Posts
    38
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to calculate pageload without Sync propert

    Thank you
    rmjobs

 

 

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 10.71%
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 08:04 PM.

Copyright BetaSoft Inc.