Results 1 to 4 of 4
  1. #1

    Select() function used with SwfTab


    I'm currently using QTP 9.2 to automate a .NET application and have bumped into a sticking point where the SwfTab object is concerned.

    The AUT has a tab-strip (much like that of a tabbed Internet browser), and I am attempting to automate switching between the forms that are located on the different tabs. I am finding that my test was running successfully up until the point where the tabs are selected, when it halts.

    I have quite a bit of WinRunner experience, and in occassions where objects aren't being accessed, I would go into the GUI Map and manually add objects and map them to any unique properties that are flagged up by the GUI object interrogation tool.

    This is not WinRunner though so instead I added an SwfTab object for each tab in the Object Repositary and tried again. The 'chap in the hat' (GUI Spy) wouldn't tell me anything that would help me distinguish between the tabs so it got me thinking... I've since found that SwfTab refers to the entire strip (?) It doesn't say this explicitly in the QTP help, so I may be wrong - if anyone can confirm / deny I'd appreciate it!

    Scrapping that idea, I looked up the useage for the select() method that belongs to objects of type SwfTab and found that it allows you to refer to the tabs by index. This works fine! However, for my test to be portable (the list of available tabs *may* be context sensitive and dynamically grow, in future builds of the AUT), I'm really aiming for being able to pass the label on the tab to the select() method, which I guess will lead me to my second question. Is this possible? Doesn't seem to work for me.

    Any suggestions gladly received. I'm still 'taming the beast' as far as QTP is concerned, however am enjoying it so far.

  2. #2
    Senior Member
    Join Date
    Jun 2007
    Toronto, Canada

    Re: Select() function used with SwfTab

    When you use GUI Spy in QTP, it does not return ordinal identifiers like index, etc which generally help in differentiating 2 differnt objects of the same type..

    Why dont you try this..
    create 2 or 3 differnt tabs in your AUT..add the first tab to the OR and then add the second and so on..
    Now go to each of the objects you just added and see if the index value differs for each one..
    If it does..then you can point to each of the tabs using index..

    if the above procedure works..then you can use childitemcount to count the number of tabs based on obj type and then loop through them to verify each of the tabs

  3. #3

    Re: Select() function used with SwfTab

    Have you tried using 'GetItemsCount' to pull back the total number of tabs, and then 'GetItem' to return the text of a tab based on index? If the tab text matches what you want, use that index in the 'Select' method.

    I don't have any sample code to work with, but this is what it appears you could do based on the Help available for the SwfTab object.
    Boyd Patterson
    Patterson Consulting, LLC

    [i]Creator of Test Design Studio - Powerful IDE for QuickTest Pro[i]

  4. #4

    Re: Select() function used with SwfTab

    Thanks for the info everyone.

    Curiously, I found that by manually entering the Tab text into the 'value' field in Keyword View seemed to jiggle it into working. Not entirely sure why as it is exactly the same as that picked up by the Record feature.

    I live and learn...



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

Copyright BetaSoft Inc.