Advertisement
SeleniumETrainR

How to do flash Testing using Selenium WebDriver? Example 1

Dec 3rd, 2012
1,237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. import org.openqa.selenium.firefox.FirefoxDriver;
  2.  
  3.  
  4.  
  5. public class permadi_INTERACTION_WITH_JAVASCRIPT {
  6.  
  7.  
  8. public static void main(String[] args) throws InterruptedException {
  9. FirefoxDriver driver = new FirefoxDriver();
  10.  
  11. driver.get("http://www.permadi.com/tutorial/flashjscommand/");
  12. driver.manage().window().maximize();
  13. FlashObjectWebDriver flashApp = new FlashObjectWebDriver(driver, "myFlashMovie");
  14. flashApp.callFlashObject("Play"); // first number
  15. Thread.sleep(3000L);
  16. flashApp.callFlashObject("StopPlay"); // operation
  17.  
  18. Thread.sleep(3000L);
  19. flashApp.callFlashObject("Rewind");
  20. System.out.println(flashApp.callFlashObject("GetVariable","/:message"));
  21. flashApp.callFlashObject("SetVariable","/:message","Learn Flash testing with Webdriver");
  22. System.out.println(flashApp.callFlashObject("GetVariable","/:message"));
  23.  
  24. }
  25.  
  26.  
  27.  
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement