You are on page 1of 1

Q.

When I click on a button on a window in testpartner, a new window


opens up. The title of the new window changes every time.
When I run the script, testpartner is not able to recognize the new
window. Is there a workaround for this?

A. You can use wildcard in the title..


Window("Caption='The*'").Attach

Or use a more generic property...


Window("Application=IEXPLORE.exe").Attach

Or determine the top window name dynamically, then attach...


hWnd = GetForegroundWindow()
strAttach = "hWnd=" & CStr(hwnd)

' Attach to the window.


Window(strAttach).Attach

You might also like