use of org.openqa.selenium.WebElement in project java.webdriver by sayems.
the class ActionBuildPerform method main.
public static void main(String... args) {
WebDriver driver = new FirefoxDriver();
driver.get("file://C:/selectable.html");
WebElement one = driver.findElement(By.name("one"));
WebElement three = driver.findElement(By.name("three"));
WebElement five = driver.findElement(By.name("five"));
// Add all the actions into the Actions builder.
Actions builder = new Actions(driver);
builder.keyDown(Keys.CONTROL).click(one).click(three).click(five).keyUp(Keys.CONTROL);
// Generate the composite action.
Action compositeAction = builder.build();
// Perform the composite action.
compositeAction.perform();
}
use of org.openqa.selenium.WebElement in project java.webdriver by sayems.
the class ClickAndHold2 method main.
public static void main(String... args) {
WebDriver driver = new FirefoxDriver();
driver.get("file://C:/Sortable.html");
WebElement three = driver.findElement(By.name("three"));
Actions builder = new Actions(driver);
// Move tile3 to the position of tile2
builder.clickAndHold(three).moveByOffset(120, 0).perform();
}
use of org.openqa.selenium.WebElement in project java.webdriver by sayems.
the class ByTagName method main.
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
List<WebElement> buttons = driver.findElements(By.tagName("button"));
System.out.println(buttons.size());
}
use of org.openqa.selenium.WebElement in project java.webdriver by sayems.
the class ByXPath method main.
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement searchButton = driver.findElement(By.xpath("//*[@id='gbqfba']"));
System.out.println(searchButton.getText());
}
use of org.openqa.selenium.WebElement in project java.webdriver by sayems.
the class GoogleSearch method main.
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement searchBox = driver.findElement(By.name("q"));
searchBox.sendKeys("Selenium");
searchBox.submit();
}
Aggregations