Search in sources :

Example 6 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver 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();
}
Also used : WebDriver(org.openqa.selenium.WebDriver) Action(org.openqa.selenium.interactions.Action) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Example 7 with FirefoxDriver

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

the class ClickAndHold method main.

public static void main(String... args) {
    WebDriver driver = new FirefoxDriver();
    driver.get("file://C:/Sortable.html");
    Actions builder = new Actions(driver);
    // Move tile3 to the position of tile2
    builder.moveByOffset(200, 20).clickAndHold().moveByOffset(120, 0).perform();
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) Actions(org.openqa.selenium.interactions.Actions)

Example 8 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver 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();
}
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 9 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver 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());
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) WebElement(org.openqa.selenium.WebElement)

Example 10 with FirefoxDriver

use of org.openqa.selenium.firefox.FirefoxDriver 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());
}
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