SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Aug 2002
    Location
    Raleigh
    Posts
    31
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Verifying that a List of Html Objects exists

    Is there a way to throw a bunch of different Html objects (HtmlText, HtmlImage, HtmlPushButton, etc.) into a List, then have a for each loop that will verify it's existance on the current web page?

    I've been trying it by using a list of windows and I continually get a false when I call the .exists() function.

  2. #2
    Senior Member
    Join Date
    Oct 2002
    Location
    Calgary, Alberta, Canada
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Verifying that a List of Html Objects exists

    Yes. I put the window names in a list and then iterate it to check that they exist. You can do a set of "do... except" statements using exists(). If any object doesn't exist, use a boolean which you set to FALSE and check the value of it at the end of the iteration. Here is an example of a way to handle this:

    private boolean funcVerifyPageContents(boolean bExists string sObject)
    do Verify(@"{sObject}".Exists(), TRUE)
    Print("Verified that the ""sObject"" object appears.")
    except
    //Raise error here if you want
    bExists = FALSE


    return bExists


    I have found that the "Exists()" function is not 100% accurate though. I get about a 90% accuracy on some runs of my suite of tests. I capture what is going on in the page with a Capture Bitmap or GetText so that I can verify whether it is a false failure on Silk Test's part.
    Beware of bugs in the above code; I have only proved it correct, not tried it.
    --Donald Knuth

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Verifying that a List of Html Objects exists

    I've extended the BrowserChild class as follows:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">winclass BrowserProdigy : BrowserChild
    LIST OF WINDOW lwRequired
    hidecalls void VerifyRequiredObjects ()
    WINDOW wOne

    if this.IsDefined (&quot;lwRequired&quot
    for each wOne in lwRequired
    do
    Verify (wOne.Exists (), TRUE, &quot;{wOne} exists&quot
    except
    ExceptLog ()
    else
    LogError (&quot;lwRequired not defined for {this}&quot
    </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Then you just have to define lwRequired in each page and what objects are required.

    - Dave
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

 

 

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 02:17 PM.

Copyright BetaSoft Inc.