Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I specify an object with a randomly generated name?
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
AND THE ANSWER IS!!!:

Code:
Dialog("text:=Mywin.*").WinButton("text:=&New").Click
So simple once you get it right!

The reasons this took me forever:
- you can have a space after the :=, but not before it, sometimes I had that wrong.
- ? does not replace a single char as I thought, actually that is '.'
- '.*' does replace any sequence of chars
- I don't know if RegExpWndTitle:= would have done it too, but text:= works, and I'm too tired of experimenting to find out if that was a problem.
- Sometimes I was using :=New, but the actual text was :=&New

Stupid little details can cause so much havoc...this is why I never want to be a programmer again...

Maybe I was talking to myself here...but in case anyone cared I thought I'd post the answer that drove me nuts for 2 days...

Random
Reply


Messages In This Thread
RE: How do I specify an object with a randomly generated name? - by RandomGrin - 12-28-2012, 02:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  UFT issues with Outsystems dynamically generated Id/names jherron 2 1,346 03-02-2020, 09:33 PM
Last Post: Swishy70
  Test runned from QualityCenter generated an error "Attempted to divide by zero." robertosalemi 1 2,567 10-14-2016, 08:38 PM
Last Post: robertosalemi
  Script is not generated for windows application in UFT sreelatha 1 2,369 04-04-2016, 10:51 AM
Last Post: vinod123
  Save randomly generated string SomeIntern 1 2,356 08-27-2013, 12:36 AM
Last Post: SomeIntern
  QTP does not recognise elements randomly Pkapoor 2 2,622 07-05-2013, 11:27 AM
Last Post: Pkapoor

Forum Jump:


Users browsing this thread: 1 Guest(s)