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();
}
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();
}
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();
}
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();
}
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);
}
Aggregations