Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.openqa.selenium.firefox.FirefoxDriver;
- import org.testng.Assert;
- import org.testng.annotations.Test;
- public class Color_shawkath {
- private final static String GREEN = "GREEN";
- private final static String BLUE = "BLUE";
- private final static String RED = "RED";
- private final static String URL = "http://tinyurl.com/c937qt7";
- @Test
- public void TestColor() throws InterruptedException{
- FirefoxDriver driver = new FirefoxDriver();
- driver.manage().window().maximize();
- FlashObjectWebDriver flashApp = new FlashObjectWebDriver(driver, "coloredSquare");
- driver.get(URL);
- //Assert.assertEquals("Clicking Colors", driver.getTitle());
- Assert.assertEquals(GREEN, flashApp.callFlashObject("getColor"));
- flashApp.callFlashObject("click");
- Thread.sleep(10000L);
- Assert.assertEquals(BLUE, flashApp.callFlashObject("getColor"));
- flashApp.callFlashObject("click");
- Thread.sleep(10000L);
- Assert.assertEquals(RED, flashApp.callFlashObject("getColor"));
- flashApp.callFlashObject("click");
- Thread.sleep(10000L);
- Assert.assertEquals(GREEN, flashApp.callFlashObject("getColor"));
- driver.quit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement