WinRunner uses a logical name to identify each object: for example “Software Testing and Quality Assurance Online Forums” for a HTML Browser Window displaying QA Forums Home Page, or “OK” for an OK button.
The logical name is actually a nickname for the object’s physical description.
The physical description contains a list of the object’s physical properties
html_name: "Software Testing and Quality Assurance Online Forums"
The logical name and the physical description together ensure that each GUI object has its own unique identification.
P.S. This info is copy pasted from WinRunner Guide. [img]images/icons/smile.gif[/img] nJoy!!
It relies on all the attributes that are in the physical description to determine the window that you are interfacing with.
If the label of the window changes (as it will in Notepad), you need to look into constructing a regular expression that will match the changing name of the window, but remains unique enough to distinguish it from all other open windows.
Insanity: doing the same thing over and over again and expecting different results
Okay thanks for the info. Let me explain you, the problem i am currently facing.
I have an application with "New" and "Edit" buttons, when clicked on New button a window is invoked with label as "New Company" and when saved it with company name as "ABC", the label changes as "New Company-ABC". As the label is changing frequently i have used regular expression.
When clicked on the "Edit" button, the same window is invoked but with the caption something as "101010-ABC" (here 101010 is the ID of the company).
I want to use the same GUI map files for both the New window and the Edit windows. If so then how to identify both the windows, when there isn't any common thing in the LABEL of the window.
Try to use the GUI spy to check if there are any other properties that are the same in the New and Edit windows and that can be used for clearly identifying this window (e.g. a special class type, application name, window size (dangerous!), ...).
If you found some properties use them instead of the window label.
PS: If the label always ends with "-ABC" you could use the regular expression: "!.*-ABC" ...