Forum Discussion

TRoper's avatar
TRoper
Occasional Contributor
12 years ago

Can I use a regular expression for the index of a window?


Hi All,


I would like to know how to use a regular express, for
example  “.*” to define the index of a window opened in my application.


Every time this window is opened, the index of the window is
incremented, making TestComplete unable to identify it after the first time the
window is opened.  If I stop and restart
the application then open the window, the index is reset back to 1 and TestComplete
can identify the window.  Nothing else
about the window changes.  I don’t care
what the index is, there can only be one instance of the window open at a
time.  I just need to be able to fill in
some information on the window.


 


Thank You


Steve

8 Replies

  • TRoper's avatar
    TRoper
    Occasional Contributor
    Thank you Stephanie,



    I tried that but the field will not take anything but an integer.



    Steve
  • sastowe's avatar
    sastowe
    Super Contributor
    What kind of obejct are you trying to access? Got snippet?
  • TRoper's avatar
    TRoper
    Occasional Contributor
    Hi Stephanie,



    Attached is a png of the object browser image.  The highlighted area is the index that keeps incrementing.  Every time the window is open, without restarting the application, this value goes up by one.  Nothing else about the window changes. And this is the only window open.



    Thanks

    Steve
  • sastowe's avatar
    sastowe
    Super Contributor
    Ah Ah. I see. Helen is right. FindChild should do the trick.
  • TRoper's avatar
    TRoper
    Occasional Contributor
    Hi,



    Thanks for you help.  I am really confused at this point.



    How would I use FindChile for a SwingObject?  If you look at the previously attached PNG file, one of the parameters of FindChild is actually the index that keeps incrementing.



    Thanks

    Steve
  • TRoper's avatar
    TRoper
    Occasional Contributor
    EUREKA!!



    I found a solution.  In the name mapping, just don't use the index!  Works!



    Thanks for you help

    Steve