Search in sources :

Example 16 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project java.webdriver by sayems.

the class DragAndDrop method main.

public static void main(String... args) {
    WebDriver driver = new FirefoxDriver();
    driver.get("file://C:/DragAndDrop.html");
    WebElement src = driver.findElement(By.id("draggable"));
    WebElement trgt = driver.findElement(By.id("droppable"));
    Actions builder = new Actions(driver);
    builder.dragAndDrop(src, trgt).perform();
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Example 17 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project java.webdriver by sayems.

the class DragMe method main.

public static void main(String... args) {
    WebDriver driver = new FirefoxDriver();
    driver.get("file://C:/DragMe.html");
    WebElement dragMe = driver.findElement(By.id("draggable"));
    Actions builder = new Actions(driver);
    builder.dragAndDropBy(dragMe, 300, 200).perform();
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Example 18 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project java.webdriver by sayems.

the class MoveByOffset method main.

public static void main(String... args) {
    WebDriver driver = new FirefoxDriver();
    driver.get("file://C:/Selectable.html");
    WebElement three = driver.findElement(By.name("three"));
    System.out.println("X coordinate: " + three.getLocation().getX() + "  Y coordinate: " + three.getLocation().getY());
    Actions builder = new Actions(driver);
    builder.moveByOffset(three.getLocation().getX() + 1, three.getLocation().getY() + 1);
    builder.perform();
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Example 19 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project java.webdriver by sayems.

the class MoveByOffsetAndClick method main.

public static void main(String... args) {
    WebDriver driver = new FirefoxDriver();
    driver.get("file://C:/Selectable.html");
    WebElement seven = driver.findElement(By.name("seven"));
    System.out.println("X coordinate: " + seven.getLocation().getX() + " Y coordinate: " + seven.getLocation().getY());
    Actions builder = new Actions(driver);
    builder.moveByOffset(seven.getLocation().getX() + 1, seven.getLocation().getY() + 1).click();
    builder.perform();
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Example 20 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver in project java.webdriver by sayems.

the class ByCSSSelector method main.

public static void main(String[] args) {
    WebDriver driver = new FirefoxDriver();
    driver.get("http://www.google.com");
    WebElement searchButton = driver.findElement(By.cssSelector("#gbqfba"));
    System.out.println(searchButton.getText());
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) WebElement(org.openqa.selenium.WebElement)

Aggregations

FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)77 WebDriver (org.openqa.selenium.WebDriver)59 WebElement (org.openqa.selenium.WebElement)46 Actions (org.openqa.selenium.interactions.Actions)18 FirefoxProfile (org.openqa.selenium.firefox.FirefoxProfile)9 File (java.io.File)8 FirefoxBinary (org.openqa.selenium.firefox.FirefoxBinary)5 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)5 ChromeDriver (org.openqa.selenium.chrome.ChromeDriver)4 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)4 URL (java.net.URL)3 Before (org.junit.Before)3 Test (org.junit.Test)3 PublicAtsApi (com.axway.ats.common.PublicAtsApi)2 FileReader (java.io.FileReader)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 BeforeClass (org.junit.BeforeClass)2 Cookie (org.openqa.selenium.Cookie)2