Example usage for org.openqa.selenium.interactions Actions Actions

List of usage examples for org.openqa.selenium.interactions Actions Actions

Introduction

In this page you can find the example usage for org.openqa.selenium.interactions Actions Actions.

Prototype

public Actions(WebDriver driver) 

Source Link

Usage

From source file:com.opera.core.systems.DriverKeysTest.java

License:Apache License

@Test
public void testSequence() {
    new Actions(driver).sendKeys("a").sendKeys("b").sendKeys("c").sendKeys("d").sendKeys("e").sendKeys("f")
            .build().perform();//from w w  w  . j  ava  2s .  c om
    assertEquals("abcdef", fieldOne.getAttribute("value"));
}

From source file:com.opera.core.systems.DriverKeysTest.java

License:Apache License

@Test
public void testMultiByte() {
    // Note that this test will fail if you have the wrong charset setup on Windows.
    new Actions(driver).sendKeys("").sendKeys("").sendKeys("").sendKeys(" ").sendKeys("").build()
            .perform();/*from ww  w.j a va 2  s. co m*/
    assertEquals("Are you sure you have the right charset setup if you're on Windows?", " ",
            fieldOne.getAttribute("value"));
}

From source file:com.opera.core.systems.DriverKeysTest.java

License:Apache License

@Test
public void testTypeSingle() {
    new Actions(driver).sendKeys("a").build().perform();
    assertEquals("a", fieldOne.getAttribute("value"));
}

From source file:com.opera.core.systems.DriverKeysTest.java

License:Apache License

@Test
public void testTypeMulti() {
    new Actions(driver).sendKeys("abcdef").build().perform();
    assertEquals("abcdef", fieldOne.getAttribute("value"));
}

From source file:com.opera.core.systems.DriverKeysTest.java

License:Apache License

@Test
public void testTypeMultiByte() {
    new Actions(driver).sendKeys(" ").build().perform();
    assertEquals(" ", fieldOne.getAttribute("value"));
}

From source file:com.opera.core.systems.DriverKeysTest.java

License:Apache License

@Test
public void testTypeNotModify() throws Exception {
    new Actions(driver).sendKeys("ac" + "left" + "b").build().perform();
    assertEquals("acleftb", fieldOne.getAttribute("value"));
}

From source file:com.opera.core.systems.DriverKeysTest.java

License:Apache License

@Test
public void testLeftArrow() {
    new Actions(driver).sendKeys("ac" + Keys.LEFT + "b").build().perform();
    assertEquals("abc", fieldOne.getAttribute("value"));
}

From source file:com.opera.core.systems.DriverKeysTest.java

License:Apache License

@Test
public void testCaseInsensitiveLeftArrow() {
    new Actions(driver).sendKeys("ac" + Keys.LEFT + "b").build().perform();
    assertEquals("abc", fieldOne.getAttribute("value"));
}

From source file:com.opera.core.systems.DriverKeysTest.java

License:Apache License

@Test
public void testTab() {
    new Actions(driver).sendKeys("ab" + Keys.TAB + "c").build().perform();
    assertEquals("ab", fieldOne.getAttribute("value"));
    assertEquals("c", fieldTwo.getAttribute("value"));
}

From source file:com.opera.core.systems.DriverKeysTest.java

License:Apache License

@Test
public void testHoldShift() {
    new Actions(driver).sendKeys("acd").sendKeys(Keys.LEFT_SHIFT + "" + Keys.LEFT + Keys.LEFT).sendKeys("b")
            .build().perform();//from  w  w  w  .  ja v  a 2 s . co m
    assertEquals("ab", fieldOne.getAttribute("value"));
}