SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with repeated SetActive() on dialogbox

    I am having a problem with the SetActive() method. It is being called repeatedly on a window, in the course of a function which is designed to make a script wait until a designated window appears, thus SetActive() is called repeatedly within a do...except statement. In my script, it is happily dealing with the window not being present gracefully a few times, but then it suddenly gets an error:
    *** Error: Window type mismatch - Expecting a top-level window or MDI child window
    This error should not be appearing unless the SetActive() method is being called on the wrong kind of window, which is obviously not the case because it is repeating the exact same call in my function.
    One thing which might be the problem is that the dialogbox in question is not declared as an instance of the DialogBox class, but as an instance of a winclass that we declared, which was itself derived from DialogBox class.
    Has anybody else had a similar or analogous problem?

  2. #2
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with repeated SetActive() on dialogbox

    OK, I found at least part of the problem. It turned out to be because the tag of the dialog-box in question referred to a unique child of the dialog thus:
    tag "[DialogBox]Alert/[StaticText]The transaction that has just been posted*"
    Changing this tag seems to stop the problem occurring; but the strange thing is that if (without changing the tag) I call the offending function from a separate testcase it isn't a problem; it is only when it is called in the course of duty so to speak, that it leads to errors.
    And of course my problem isn't solved, because I need the tag for this dialog to reference the static text within it, because there are more than one dialog with identical captions, window ids are unavailable to use for windows in our app.

    Anybody got any bright ideas as to what is going on here?

  3. #3
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with repeated SetActive() on dialogbox

    It seems that you are using brute force where a simple IfExists() would work. A SetActive() is doomed to fail if the window does not currently exist. An IfExist() is much more graceful and does not require a do...except wrapper.

    I take it that the Alert dialog is a generic warning dialog that appears numerous places within the application?

    You might consider changing the tag for the dialog to just "[Dialogbox]Alert" and then identify the static text string within it as a separate object tagged with [StaticText]#1.

    You could then have a while loop wait for a TRUE return from an Alert.IfExists(), followed by a routine to process the contents of the #1 static text.

    You may find that you have a parentage issue with the dialog since it appears in numerous places. If so look up the tag modifier ~ActiveApp to get around this.

  4. #4
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with repeated SetActive() on dialogbox

    Vince,

    You can try changing the tag of the dialog to

    tag "[DialogBox]Alert/[StaticText]The transaction that has just been posted*/.."

    This tells SIlkTest to find the dialog, find the static text, then find its parent (the dialog box again). Using this type of tag causes Record Identifiers and Record Actions and Record Testcase to not be able to recognize the dialog, but playback should work perfectly.

    Let us know if this helps.

 

 

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 05:48 AM.

Copyright BetaSoft Inc.