SPONSORS:






User Tag List

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Jan 2000
    Location
    US
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    conditional testframe.inc?

    I want to be able to conditional use different window declarations from the same testframe include file, but I want the declaration Identifiers to be the same name.

    Here is my problem:

    I have a link that appears as HTMLHEADING on Netscape and HTMLLINK in IE. The TAGS are the same.

    I do not want to change my code, but rather use a different window declaration during script execution.

    Example:

    MySite.RegisterLink.Click()

    Can I have one test frame .inc that contains two window declarations that have the same Identifier MySite. One would have HTMLHEADING RegisterLink and the other will have HTMLLINK RegisterLink.

    I want to be able to switch during execution depending on the current browser.

    If not....

    do I have to have two seperate include files and switch at runtime? I tried this, but I was having trouble doing this without writing a function that would be called before every testcase execution.

    Any help would be great.


  2. #2
    Junior Member
    Join Date
    Nov 1999
    Location
    Chicago, IL USA
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: conditional testframe.inc?

    I had the same problem for a lot of our links.

    What I did was extend the HtmlLink Click() method so that it if the link didn't exist, but a control with the same name + "Heading" existed, click that.

    if this.Exists()
    derived :: Click(iButton, iXpos, iYpos)
    else
    if this.GetParent().IsDefined("{this.sName}Heading")
    if @("{this.sName}Heading").Exists()
    @("{this.sName}Heading").Click()
    else
    LogError ("Link/Heading does not exist")
    else
    LogError ("Link does not exist")


    Then all I have to do is make sure I declare both MyLink and MyLinkHeading for any link that exhibits this behavior.

    It's not pretty but until Segue fixes netscape.inc to recognize this stuff better, not sure what else can be done.


    By the way, I don't know if this was discussed anywhere before on this forum, but I can't extend Html* methods if I reference my class methods include file in the Use Path in runtime options. I have to put a use statement in my scripts. Kinda weird, but I guess I can live with it if that's the way it's gotta be.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 11:11 PM.

Copyright BetaSoft Inc.