Closed x1nas closed 7 years ago
Found this solution:
import com.athaydes.automaton.Swinger;
import java.awt.Window;
swinger = Swinger.getUserWith( Window.windows[1] );
swinger.clickOn( "text:OK" )
Swinger.forSwingWindow()
should do the same.
Swinger.forSwingWindow() should do the same.
Doesn't work for me:
AScript failed due to com.athaydes.automaton.GuiItemNotFound: Component not showing on screen:
Swinger.forSwingWindow()
takes the first window available... in your example, you take the second one, so that explains why my suggestion didn't work..
If you have more than one windows, you should select the right window.. .Try to find it by name to make your test more reliable. Example:
myAppWindow = Window.windows.find { it.name == 'My App' }
if (!myAppWindow) throw new Exception("Could not find my window")
I use manual to run groovy script from command line. First window of my-app.jar - login window. After login another window opens. How to catch and use another window?