Search in sources :

Example 51 with FirefoxDriver

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

the class ClickAndHoldAndRelease 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).release().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 52 with FirefoxDriver

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

the class ClickAndHoldAndReleaseOnWebElement 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"));
    WebElement two = driver.findElement(By.name("two"));
    Actions builder = new Actions(driver);
    // Move tile3 to the position of tile2
    builder.clickAndHold(three).release(two).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 53 with FirefoxDriver

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

the class ClickOnWebElement 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 eleven = driver.findElement(By.name("eleven"));
    WebElement five = driver.findElement(By.name("five"));
    int border = 1;
    int tileWidth = 100;
    int tileHeight = 80;
    Actions builder = new Actions(driver);
    //Click on One
    builder.click(one);
    builder.build().perform();
    // Click on Eleven.
    builder.click(eleven);
    builder.build().perform();
    //Click on Five
    builder.click(five);
    builder.build().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 54 with FirefoxDriver

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

the class Refresh method main.

public static void main(String[] args) {
    WebDriver driver = new FirefoxDriver();
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    driver.get("http://www.google.com");
    driver.navigate().refresh();
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver)

Example 55 with FirefoxDriver

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

the class WindowHandling method main.

public static void main(String... args) {
    WebDriver driver = new FirefoxDriver();
    driver.get("file://C:/Window.html");
    String window1 = driver.getWindowHandle();
    System.out.println("First Window Handle is: " + window1);
    WebElement link = driver.findElement(By.linkText("Google Search"));
    link.click();
    String window2 = driver.getWindowHandle();
    System.out.println("Second Window Handle is: " + window2);
    System.out.println("Number of Window Handles so for: " + driver.getWindowHandles().size());
    driver.switchTo().window(window1);
}
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)82 WebDriver (org.openqa.selenium.WebDriver)61 WebElement (org.openqa.selenium.WebElement)47 Actions (org.openqa.selenium.interactions.Actions)18 FirefoxProfile (org.openqa.selenium.firefox.FirefoxProfile)10 File (java.io.File)8 ChromeDriver (org.openqa.selenium.chrome.ChromeDriver)7 FirefoxBinary (org.openqa.selenium.firefox.FirefoxBinary)6 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)5 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)5 URL (java.net.URL)4 Before (org.junit.Before)4 PhantomJSDriver (org.openqa.selenium.phantomjs.PhantomJSDriver)4 Test (org.junit.Test)3 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)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