Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. public class ETReduxFrameTest {
  2. private Swinger swinger;
  3.  
  4. @BeforeClass
  5. public static void setUpClass() throws Exception {
  6. // Run this program as a GUI application
  7. System.setProperty("java.awt.headless", "false");
  8.  
  9. // Create new ETRedux Instance
  10. new ETRedux(new File("reduxPath"));
  11.  
  12. // sleep to give window time to initialize
  13. Thread.sleep(3000);
  14. }
  15.  
  16. @Before
  17. public void setUp() {
  18. // create new swinger for main window
  19. swinger = Swinger.forSwingWindow();
  20. }
  21.  
  22. @Test
  23. public void testETRedux() throws Exception {
  24. List<Component> cs;
  25. String str;
  26.  
  27. // Get more than one component
  28. cs = swinger.getAll("type:ET_JButton");
  29. cs.forEach(c -> System.out.println("text: " + ((ET_JButton)c).getText()));
  30.  
  31. // Get a single component with more complex selectors
  32. str = "Welcome! Please Visit us at GitHub.com";
  33. Component button = swinger.getAt(matchingAll("type:ET_JButton", "text:" + str));
  34. swinger.clickOn(button);
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement