SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Feb 2004
    Location
    London - UK
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Testing for object existance/page load.

    Hi all, I have a dynamic web page that when you access it, it displays one combo box. You then select something from combo box 1 press "Ok" then the page reloads and combo box 2 is displayed.

    I am trying to automate the testing of this page. Test Partner clicks the ok button then the code goes on to select something from combo box 2.

    The problem is that TP does not allow enough time for the page to refresh - plus the refresh time is variable depending on server load.

    This means that TP falls over with an automation error as it cant locate combo 2 on the page.

    What I need is a method to either:

    1. Check for the existance of combo box 2.

    - or -

    2. Determine if the page has finished loading and then combo box 2 will be displayed.

    Thanks in advance,

    Tim.

  2. #2
    Senior Member
    Join Date
    Feb 2003
    Posts
    151
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Testing for object existance/page load.

    Tim,

    To check if an object is on a page, you can use the "exists" property, but you need to set a TPAttachNoWait flag ie
    HTMLComboBox("Name='$Req.cos$'", TPAttachNoWait).exists

    To determine the page has completed loading you could set up a "wait event" for the word "Done" in the lower left hand corner of the browser, or some other event depending on the behavior of your application. Another option would be to use the "exists" technique above in a loop of some type. Also take a look at the playback timing options and see if you need to modify the way TP works against your application.

    Hope this helps

  3. #3
    Senior Member
    Join Date
    Sep 2001
    Location
    Philly
    Posts
    1,231
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Testing for object existance/page load.

    To expand on smeagol's option 1)

    Do until HTMLComboBox("Name='$Req.cos$'", TPAttachNoWait).exists = true
    sleep 1
    loop

    Note... if your app uses FRAMES, your problem may not be that the editbox is not there in time (just turn your attach-time-out value up), but rather TP is attaching the the HTMLFrame(name=xxx) before it is refreshed, so tp thinks the combo its looking for went away with the frame that just refreshed. The reson this happens is that Frames tend to have the same Name property.

    You can get past this with manually entering a sleep x before the Frame attach, or potentially remove the Frame Attach all together.

    Hope this helps,
    ~Alias~

 

 

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 12:31 AM.

Copyright BetaSoft Inc.