Results 1 to 8 of 8
  1. #1

    Attempting to close all Mappable Children

    Is there a way to easily close all the mappable children of an object?

    I am attempting to run a DFT and sometimes screens get hung up and I would like to have the script simply close all the child objects and then continue on.

    Any Ideas would be helpful


  2. #2

    Re: Attempting to close all Mappable Children


    You can use something like:

    TestObject[] testObj = yourObject.getMappableChildren();
    for (int i = 0; i < testObj.length; i++)
    or make a method of this code that calls itself recursively to send a close to all children in whole depth, but I think closing all toplevel children will be sufficient.


  3. #3

    Re: Attempting to close all Mappable Children

    Thanks Bennyvw

    I had to change testObj[i].close() to testObj[i].dispose() to catch a few other things. I hope that won't cause any trouble later.

  4. #4

    Re: Attempting to close all Mappable Children

    1. close() is not a method in TestObject, but in TopLevelTestObject, so the code posted will not compile.

    2. A TopLevelWindow will very rarely be the child of any GUI object, so calling getMappableChildren() will rarely return any object on which you can call close().

    3. You can get the TopLevelTestObjects on your Desktop by calling getDomains() (which returns an array of DomainTestObjects) and then calling getTopLevelWindows on all of the objects in the array of DomainTestObjects.

  5. #5

    Re: Attempting to close all Mappable Children

    typo on my part in step 3: call getTopObjects(), not getTopLevelWindows()

  6. #6

    Re: Attempting to close all Mappable Children

    Hi Chirillo,
    when i try to get

    DomainTestObject dom[] = getDomains();
    TestObject objArr[] = null;
    objArr = dom[0].getTopObjects();
    TestObject[] testObjects = objArr[0].getChildren();

    then i tried to extract children i couldn't extract table, textboxes, buttons.
    But its showing Html.HtmlDocument, Html.HtmlBrowser.ToolbarButton(18 objects) these two only.

    if you have any suggestion how to get table,testboxes,buttons from the TestObject, am I making any mistake, any example code will be greatly appreciable...

  7. #7

    Re: Attempting to close all Mappable Children

    Hi have a loop for all the domains you are getting... I think you are accessing only html domain and browser object...

  8. #8

    Re: Attempting to close all Mappable Children

    everything in the client area of a browser is a child of the HTML Document, so you have to call getChildren() on the document...and then getChildren() on those question.

    You have to learn recursion.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:55 PM.

Copyright BetaSoft Inc.