Advertisement
SeleniumETrainR

how to automate flash application with selenium webdriver? E

Dec 3rd, 2012
1,398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. import org.openqa.selenium.firefox.FirefoxDriver;
  2. import org.testng.Assert;
  3. import org.testng.annotations.Test;
  4.  
  5.  
  6. public class Color_shawkath {
  7.  
  8.  
  9. private final static String GREEN = "GREEN";
  10. private final static String BLUE = "BLUE";
  11. private final static String RED = "RED";
  12. private final static String URL = "http://tinyurl.com/c937qt7";
  13.  
  14. @Test
  15. public void TestColor() throws InterruptedException{
  16. FirefoxDriver driver = new FirefoxDriver();
  17. driver.manage().window().maximize();
  18. FlashObjectWebDriver flashApp = new FlashObjectWebDriver(driver, "coloredSquare");
  19.  
  20. driver.get(URL);
  21.  
  22. //Assert.assertEquals("Clicking Colors", driver.getTitle());
  23.  
  24. Assert.assertEquals(GREEN, flashApp.callFlashObject("getColor"));
  25. flashApp.callFlashObject("click");
  26. Thread.sleep(10000L);
  27. Assert.assertEquals(BLUE, flashApp.callFlashObject("getColor"));
  28. flashApp.callFlashObject("click");
  29. Thread.sleep(10000L);
  30. Assert.assertEquals(RED, flashApp.callFlashObject("getColor"));
  31. flashApp.callFlashObject("click");
  32. Thread.sleep(10000L);
  33. Assert.assertEquals(GREEN, flashApp.callFlashObject("getColor"));
  34.  
  35. driver.quit();
  36. }
  37.  
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement