use of org.openqa.selenium.firefox.FirefoxDriver in project java.webdriver by sayems.
the class ByLinkText method main.
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement aboutLink = driver.findElement(By.linkText("About Google"));
aboutLink.click();
}
use of org.openqa.selenium.firefox.FirefoxDriver in project java.webdriver by sayems.
the class ByName method main.
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement searchBox = driver.findElement(By.name("btnK"));
searchBox.submit();
}
use of org.openqa.selenium.firefox.FirefoxDriver in project java.webdriver by sayems.
the class ByPartialLinkText method main.
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement aboutLink = driver.findElement(By.partialLinkText("About"));
aboutLink.click();
}
use of org.openqa.selenium.firefox.FirefoxDriver in project java.webdriver by sayems.
the class StoreCookieInfo method main.
public static void main(String... args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.facebook.com");
driver.findElement(By.name("email")).sendKeys("<<ur mailID>>");
driver.findElement(By.name("pass")).sendKeys("<<ur password>>");
driver.findElement(By.name("persistent")).click();
driver.findElement(By.name("pass")).submit();
File f = new File("browser.data");
try {
f.delete();
f.createNewFile();
FileWriter fos = new FileWriter(f);
BufferedWriter bos = new BufferedWriter(fos);
for (Cookie ck : driver.manage().getCookies()) {
bos.write((ck.getName() + ";" + ck.getValue() + ";" + ck.getDomain() + ";" + ck.getPath() + ";" + ck.getExpiry() + ";" + ck.isSecure()));
bos.newLine();
}
bos.flush();
bos.close();
fos.close();
} catch (Exception ex) {
ex.printStackTrace();
}
}
use of org.openqa.selenium.firefox.FirefoxDriver in project java.webdriver by sayems.
the class ContextClick2 method main.
public static void main(String... args) {
WebDriver driver = new FirefoxDriver();
driver.get("file://C:/ContextClick.html");
WebElement contextMenu = driver.findElement(By.id("div-context"));
Actions builder = new Actions(driver);
builder.moveToElement(contextMenu).contextClick().click(driver.findElement(By.name("Item 4"))).perform();
}
Aggregations