SPONSORS:






User Tag List

Results 1 to 10 of 10
  1. #1
    Junior Member
    Join Date
    May 2001
    Location
    Houston, TX, USA
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there an \"exists\" method for objects?

    I am a former WinRunner automation engineer and am using Silk now (new company).

    Is there a method like exists, but for objects? Exists works on windows only.

    Thanks in advance.

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

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is there an \"exists\" method for objects?

    Why don't you try it?

    just make a

    winclass a : anywin
    window newclass= a()

    do
    print(newclass.exists())
    except
    print("can't use exists() on object")

    I don't think you can use it for classes that are not derived from anywin(which has exists).

    I hope I am not wrong.

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

  3. #3
    Senior Member
    Join Date
    Dec 2000
    Location
    NY, NY, USA
    Posts
    165
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is there an \"exists\" method for objects?

    The exists method belongs (and can therefore be used) to the AnyWin class and its subclasses, including
    the PushButton class (or the CustomWin class).

    So, you should be able to say,
    if (window.Exists ())...

    Of course, the 'window' above might be the Cancel button of an Open window, so you'd code---if (Open.Cancel.Exists())...

    Jerry

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

  4. #4
    Senior Member
    Join Date
    Dec 2000
    Location
    NY, NY, USA
    Posts
    165
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is there an \"exists\" method for objects?

    In SilkTest, ALL objects are called windows!
    The terminology is confusing.

    So the exists method will work on all objects (WR-speak) / windows (ST-speak).

    Good Luck;
    Jerry

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

  5. #5
    Junior Member
    Join Date
    May 2001
    Location
    Houston, TX, USA
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is there an \"exists\" method for objects?

    OK, let me clarify.

    I have a window that has multiple pages (PageList). For some reason, SilkTest will not select the Tabs as can be normally done. Therefore, I am verifying the page I am on by whether or not an object (textfield, pushbutton, etc) specific to that page exists or not.

    When I tried the code originally, it told me that "Exists" does not apply to non-windows.

    I have since found an alternate route to address the issue, but I am still curious as to an Exists method for objects in a window as opposed to the actual window...

    Thanks for the help.

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

  6. #6
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is there an \"exists\" method for objects?

    Yes, Jerry is exactly right. You have to look at the inheritance.

    I will frequently use Exists(i) in situations where the machine is cranking away for some time and the test needs to wait for a page or object to appear. This works well for something like
    <code> while !ThisButton.Exists(30)</code>

    then sleep for two or three seconds.

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


    [This message has been edited by DJGray (edited 05-16-2001).]

    [This message has been edited by DJGray (edited 05-16-2001).]

  7. #7
    Junior Member
    Join Date
    May 2001
    Location
    Houston, TX, USA
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is there an \"exists\" method for objects?

    Thanks for all the help. I'll try it again.

    JBG

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

  8. #8
    Senior Member
    Join Date
    Oct 1999
    Location
    Tyngsborough, MA
    Posts
    211
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is there an \"exists\" method for objects?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by jgeorge:
    Therefore, I am verifying the page I am on by whether or not an object (textfield, pushbutton, etc) specific to that page exists or not.
    <HR></BLOCKQUOTE>

    Question for you. In a pagelist, do the objects on the hidden tabs 'exist' or not? I would not be surprised if they exists even though they are not displayed.


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

  9. #9
    Junior Member
    Join Date
    May 2001
    Location
    Houston, TX, USA
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is there an \"exists\" method for objects?

    That's probably right. They do exist. SO the question is, is there a better method to verify whether the object can be seen or edited?

    JBG

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

  10. #10
    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: Is there an \"exists\" method for objects?

    The "PageList" control behaves differently in different development environments and also with different development approaches. When I started using QAP on a powerBuilder app I was in heaven ebcasue PageLists worked easy for me. On my current Java and C++ apps I have a different situation every time I encounter a new pagelist control.

    In my Java app there's no "container" around each tab (like there was a DataWindow for each tab in PowerBuilder). In one of the PageLists in my C++ app it works beautifully but in the others my developers told me they did not use the actual "PageList" class when building the pagelist so those behave like the Java one. And we're converting everything to be browser-based soon anyway so we will not be rectifying the development choice issue in this app.

    Also, I just want to reiterate the stuff about the term "window". It does in fact apply to all controls or objects, not just *MainWin and *Dialogbox class controls. The reason is historical. So whenever you see the term "window" used within SilkTest, interpret it as "control" or "object" and you'll be fine.

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

 

 

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 07:15 PM.

Copyright BetaSoft Inc.