use of org.openqa.selenium.WebElement in project java.webdriver by sayems.
the class GetAttributes method main.
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement searchButton = driver.findElement(By.name("btnK"));
System.out.println("Name of the button is: " + searchButton.getAttribute("name"));
System.out.println("Id of the button is: " + searchButton.getAttribute("id"));
System.out.println("Class of the button is: " + searchButton.getAttribute("class"));
System.out.println("Label of the button is: " + searchButton.getAttribute("aria- label"));
}
use of org.openqa.selenium.WebElement in project java.webdriver by sayems.
the class GetCSSValue method main.
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement searchButton = driver.findElement(By.name("btnK"));
System.out.println(searchButton.getCssValue("font-family"));
}
use of org.openqa.selenium.WebElement in project java.webdriver by sayems.
the class GetSize method main.
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement searchButton = driver.findElement(By.name("btnK"));
System.out.println(searchButton.getSize());
}
use of org.openqa.selenium.WebElement in project gitblit by gitblit.
the class GitblitDashboardView method login.
public void login(String id, String pw) {
String pathID = LOGIN_AREA_SELECTOR + "/input[@name = \"username\" ]";
String pathPW = LOGIN_AREA_SELECTOR + "/input[@name = \"password\" ]";
String pathSubmit = LOGIN_AREA_SELECTOR + "/button[@type = \"submit\" ]";
// System.out.println("DRIVER:"+getDriver());
// List<WebElement> findElement =
// getDriver().findElements(By.xpath("//span[@class = \"form-search\" ]"));
//
// System.out.println("ELEM: "+findElement);
// System.out.println("SIZE: "+findElement.size());
// System.out.println("XPath: "+pathID);
WebElement idField = getDriver().findElement(By.xpath(pathID));
// System.out.println("IDFIELD:"+idField);
idField.sendKeys(id);
WebElement pwField = getDriver().findElement(By.xpath(pathPW));
// System.out.println(pwField);
pwField.sendKeys(pw);
WebElement submit = getDriver().findElement(By.xpath(pathSubmit));
submit.click();
}
use of org.openqa.selenium.WebElement in project gitblit by gitblit.
the class GitblitPageView method getElementWithFocus.
public WebElement getElementWithFocus() {
String elScript = "return document.activeElement;";
WebElement focuseedEl = (WebElement) ((JavascriptExecutor) getDriver()).executeScript(elScript);
return focuseedEl;
}
Aggregations