Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ETReduxFrameTest {
- private Swinger swinger;
- @BeforeClass
- public static void setUpClass() throws Exception {
- // Run this program as a GUI application
- System.setProperty("java.awt.headless", "false");
- // Create new ETRedux Instance
- new ETRedux(new File("reduxPath"));
- // sleep to give window time to initialize
- Thread.sleep(3000);
- }
- @Before
- public void setUp() {
- // create new swinger for main window
- swinger = Swinger.forSwingWindow();
- }
- @Test
- public void testETRedux() throws Exception {
- List<Component> cs;
- String str;
- // Get more than one component
- cs = swinger.getAll("type:ET_JButton");
- cs.forEach(c -> System.out.println("text: " + ((ET_JButton)c).getText()));
- // Get a single component with more complex selectors
- str = "Welcome! Please Visit us at GitHub.com";
- Component button = swinger.getAt(matchingAll("type:ET_JButton", "text:" + str));
- swinger.clickOn(button);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement