Guest User

Untitled

a guest
Dec 14th, 2013
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. public static Screen s;
  2. public static Region r;
  3. public static App firefox;
  4.  
  5. public static void main(String[] args) throws Exception {
  6. setup();
  7.  
  8. // Wait for login prompt
  9. s.wait("images/login_prompt.png", 25);
  10.  
  11. // Fill in email
  12. Pattern p = new Pattern("images/login_email.png").similar((float) 0.69).targetOffset(-125,12);
  13. //s.type(p,"a", Key.CTRL);
  14. s.type(p,"test");
  15.  
  16.  
  17.  
  18. tearDown();
  19. }
  20.  
  21. public static void setup() throws Exception{
  22. s = new Screen(0);
  23. s.setFindFailedResponse(FindFailedResponse.SKIP);
  24. firefox = new App("C:/Program Files (x86)/Mozilla Firefox/firefox.exe");
  25. firefox.open();
  26. }
  27.  
  28. public static void tearDown() throws FindFailed{
  29. //s.click("images/signout.png");
  30. firefox.close();
  31. }
Advertisement
Add Comment
Please, Sign In to add comment