SPONSORS:






User Tag List

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

    Low-level methods for PageList?

    I would like to code a method, using low-level mouse actions, to click on a certain tab on a PageList. Unfortunately the tabs of a pagelist don't seem to be available as individual objects (GetContents() simply returns a list of string corresponding to the tab captions) and none of the methods for the PageList class seem very helpful. Does anybody have any ideas?

    P.S. The number and position of the tabs in the PageList changes, so I can't rely on a tab being in a certain hard-coded position; if I knew how to find the position at run-time then I could force a mouse-click by those co-ordinates, but I can't see how.

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

  2. #2
    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: Low-level methods for PageList?

    Don't know if it will help, but I'm being forced to find Page Tab positions by locating the HtmlText (Caption) on the tabs. If you can see that text it may work for you. Don't know if your app is Html or something other...



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

  3. #3
    KS
    KS is offline
    Senior Member
    Join Date
    May 2001
    Posts
    265
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Low-level methods for PageList?

    looking for further clarification. if it returns a list of string is it not looking at it as individual items?

    if you get individual string (the captions of tabs) then getrect should help get positions.

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

  4. #4
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Low-level methods for PageList?

    Why can't you use FindPage to get the index of the tab and then use the Select(iIndex) to select it? Or just use Select(sPageName) to select it? Is there a certain reason you have to use low-level mouse actions?

    ------------------
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

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

    Re: Low-level methods for PageList?

    Is the PageList for a Java or HTML app?


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

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

    Re: Low-level methods for PageList?

    In answer to the questions:
    - the aut is a normal desktop app, not browser-based or java or anything.
    - GetContents() returns a list of tab captions, but this doesn't indicate what kind of class the tabs would be, if I could treat them as individual objects. And if I don't know how to treat the tabs as individual objects, then I can't call the GetRect() method.
    - I specifically want to find a way of not using Select(iIndex), but use low-level calls. The context is that I am trying to reproduce a bug reported by a customer which seems to be connected with the low-level window messages the aut is producing (specifically WM_REQUESTFOCUS and WM_REQUESTBIGDRAG). I have tried to reproduce the bug using the Select() method of the PageList class, but that hasn't succeeded; I am hoping that doing the same thing but with low-level calls to individual mouse movements and clicks, I might have better luck.
    P.S. The bug is very intermittent; it might manifest itself less than once per full user-day, so that's why I want to use silktest to try and replicate it for me.

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

  7. #7
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Low-level methods for PageList?

    Note: after posting, I realized I misinterpreted the question. Oh, well this might help.

    I deal with the tabs of a Pagelist as separate objects. It greatly simplifies my tests.

    I record the contents of each tab separately, then cut and paste them as separate PageLists (with different names) in one window.

    Each of these Pagelists has the same tag. Instead of using that tag -- use a function not only gives you the tag, but that ALSO activates that particular tab.

    Then whenever SilkTest searches for a particular Tab in the Pagelist, it activates it automatically.

    It works very well and it makes thing much simpler.

    There are quick-hack ways to do this and elegant Object-Oriented ways to do this.
    Here is a clean, but not-so-elegant example:

    ------------------
    Rob Kapteyn


    [This message has been edited by RobKapteyn (edited 10-01-2002).]
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

  8. #8
    Super Member
    Join Date
    Jul 2001
    Location
    Earth
    Posts
    1,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Low-level methods for PageList?

    You can also utilize the Windows API for something like this. I ran into a situation where the Select method didn't work and the control had some custom code to look for an actual mouse event rather than the keyboard event that the Select method uses. (never mind the comments of why this is a bad idea for a control, I KNOW).

    Anyway...There is an API call to return the RECT of a tab, but you will have to create a DLL that calls it rather than using the built-in DLL calling functionality because it deals with pointers that SilkTest can't handle.



    ------------------
    James Soderborg
    http://www.ameliortech.com
    jamesso@ameliortech.com

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

    Re: Low-level methods for PageList?

    To locate each page list tab, use a PageList.GetRect() and divide the xSize value by the PageList.GetPageCount(). With this information you should be able to move to and click/drag whatever tab you want based on coordinate offsets. A PageList.FindPage() will return the index for any desired tab.

    To make this simple I'd suggest overriding the PageList class Select() method so that you could easily switch back to the normal Select-based access method without having to find or change any testcases.


    John


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

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

    Re: Low-level methods for PageList?

    John Miller: Unfortunately the tabs are organised into two or three rows, and of course the rows switch forwards and backwards depending on which tab is selected. This means that I can't just use the the xSize value from GetRect on the pagelist and divide by the number of tabs, unfortunately.
    Rob: Thanks for that, it's not a solution to my current problem but it does look like a way of making normal tab-selection code better.
    James: That sounds very promising, can you point me in the direction of the relevant API?

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

 

 
Page 1 of 3 123 LastLast

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 11:07 AM.

Copyright BetaSoft Inc.