SPONSORS:






User Tag List

Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    May 2000
    Location
    NY
    Posts
    52
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Has anyone successfully extended BrowserChild ?

    Greetings, fellow Segue enthusiasts,

    I recently tried to add a method to the BrowserChild class in my declarations file via:

    winclass BrowserChild : BrowserChild
    ...

    When compiling the declarations, I recieved the following 2 error messages.

    1. browser.inc - Window Class browserchild is already defined in module Master.inc at line 2234
    2. master.inc - window class browserchild is not defined or ambiguous

    Has anyone successfully added methods to a browser child, and are there any 'tricks' involved ?


    Thanks in advance,
    Joe V.
    2. Window class


  2. #2
    Senior Member
    Join Date
    Mar 2000
    Location
    Dublin, Ireland
    Posts
    152
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Has anyone successfully extended BrowserChild ?

    Hi,

    1. browser.inc - Window Class browserchild is already defined in module Master.inc at line 2234

    2. master.inc - window class browserchild is not defined or ambiguous

    Are you referencing 'master.inc' from 'browser.inc', that is do you have 'use 'master.inc'' in the browser.inc file? If so, remove the reference. Only make reference to 'master.inc' from your frame file and ensure that the browser extensions are loaded correctly. If the browser extentsions are correctly loaded, then 'browser.inc' should be reference by default, through 'explorer.inc' or 'netscape.inc' etc..

    Within your framework declare new methods for existing classes (that is extend an existing class) in one place only. If you are still running into problems extending the class, backup the existing 'browser.inc' and add the methods to the class declaration in that file.

    I hope that this helps.

    John.



    ------------------

    John O'Neill.
    Quality Automation Ltd.
    www.quality-automation.com
    John O'Neill.
    Quality Automation Ltd.
    www.quality-automation.com

  3. #3
    Member
    Join Date
    May 2000
    Location
    NY
    Posts
    52
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Has anyone successfully extended BrowserChild ?

    John,

    Thanks for the suggestions. 'Master.inc' is the name of my one and only frame file, and I did not alter the browser.inc file in any way - the browser.inc is actually referenced from my domex.inc. Finally, the browser extensions are definitely loaded properly, and I am extending the class BrowserChild in only one place in my frame file (i.e. 'Master.inc').

    I also tried adding a method directly to the browser.inc file, and while it gave no syntax errors, when I clicked Ctrl-alt, the 'Capturing Properties' box still hung.

    Still can't get my BrowserChild methods to appear in Verify Properties. Have you actually done this on your own app ?


    Thanks,
    Joe V.

  4. #4
    Senior Member
    Join Date
    Aug 1999
    Location
    San Diego, CA USA
    Posts
    219
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Has anyone successfully extended BrowserChild ?

    Not sure if this is the answer, but ...

    I ran into the same problem a few years ago when trying to extend a class that was defined in the PowerBuilder extensions. I'm thinking this might apply becasue BrowserChild is actually defined in the Browser extensions. Browser support in SilkTest is actually implemented as an "extension" not as part of the "core" of SilkTest per say (like VB and C++ controls are).

    It had something to do with the order that Silk loads its "core" stuff, your frame file, and the "extensions". The bottom line was that classes defined in "extensions" cannot be "extended" using the same approach as a built-in class becasue they are already extended. You have to actually update the extension's .inc file (browser.inc, explorer.inc, etc.). Of course then you have to commit to maintaining your modifications to these files with each new version of SilkTest and need to have a process to ensure that you modified files are deployed to every machine that needs them. If you're interested in taking this approach, you will be interested in the presentation I'm giving at QUEST.

    Another approach is instead of extending the class, create a new class with a slightly different name (i.e., MyBrowserChild). This approach works great for a client-type AUT (like my PB app from years ago and my current Java client app) because all window decs are in my frame file and thus under my control. It might not work for browsers if you need your customized stuff to be available to browser windows that are defined in the Silk extensions files.

    [This message has been edited by pcostigan (edited 03-08-2001).]

  5. #5
    Member
    Join Date
    May 2000
    Location
    NY
    Posts
    52
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Has anyone successfully extended BrowserChild ?

    Thank pcostigan - I think you hit the nail on the head with being unable to extend items in the extension file.

    Unfortunately, I will be unable to attend Quest this year, though any hints you could give me on how to extend the extensions would be greatly appreciated (I would be happy to wait until after you debut your approach at Quest).

    Also, please let me know the name, date and time of your presentation in the event a friend of mine can attend.

    Thanks,
    Joe V.


  6. #6
    Senior Member
    Join Date
    Aug 1999
    Location
    San Diego, CA USA
    Posts
    219
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Has anyone successfully extended BrowserChild ?

    Thanks for asking. Date/time slots for QUEST presentations have not yet been assigned. I can tell you that the title is "SilkTest Configuration Made Easier" and it has been categorized under Reliability Topics / Verification by Segue. Don't hold me to this, but I think I heard/read somewhere that Segue plans to make all presentations available on their web site after QUEST. I do know for sure that those who attend QUEST will get a CD of the presentations.

    The basic jist of the solution is that you would have to edit the extensions file directly. Those files are stored in the SilkTest install directory then the \extend subfolder. Be sure to stick the original version of the file in your version control tool followed by your updated version. The complications come in deployment and maintenance. You have to have a process to ensure that all machines are using your updated file. Also, you have to commit to re-applying your updates with each new version of Silk.

  7. #7
    Member
    Join Date
    Nov 2000
    Location
    Shelton, CT, USA
    Posts
    32
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Has anyone successfully extended BrowserChild ?

    Hi,

    I've run into this problem several times. Try doing this: Inside of your Master.inc file create a winclass declaration for AnyWin and put all of your methods for BrowserChild into this declaration. BrowserChild is derived from the AnyWin class so any method you've entered for AnyWin will flow to the BrowserChild class. For example:
    winclass AnyWin : AnyWin
    string Foo ()
    return "Hello"

    You can now use the method Foo on a BrowserChild. Since almost everything inherits from AnyWin, I do some testing inside of my AnyWin methods to assure I'm using the method on the correct Class. For example: if ( this.GetClass() != HtmlTable )raise 1, "Oops... Incorrect class type"
    Use this same procedure when you want to extend any of the web classes. You can't extend the HtmlTextField, but you can extend the TextField class.
    winclass TextField : TextField
    string Vark ( )
    print ("hello world")

    Important safety tip, make sure you do all of these declarations from inside of 1 inc file. If you accidentally declare a duplicate winclass you can GPF SilkTest. If you have your UseFiles in Runtime options set as

    UseFiles=c:\work\inc\master.inc, extend\explorer.inc -- You'll GPF

    if they're set as:
    UseFiles=extend\explorer.inc, c:\work\inc\master.inc -- You'll get error messages for the dup....

    Order sometimes does matter. Reported this ages ago, has never been fixed. If you do GPF, don't panic. Comment out the useFiles line in partner.ini and find the duplicate.

    -Michael


  8. #8
    Senior Member
    Join Date
    Aug 1999
    Location
    San Diego, CA USA
    Posts
    219
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Has anyone successfully extended BrowserChild ?

    Clever! I never thought to reverse the "default" order of the Use Files string.

 

 

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 09:25 AM.

Copyright BetaSoft Inc.