You can declare a variable of type WINDOW to store a window identifier and then reference the window using the variable name, instead of using the window identifier as specified in the window's declaration.
// The window declaration window MainWin Notepad ... // code in the testcase WINDOW w w = Notepad w.File.Open.Pick ()