use of org.openqa.selenium.WebDriver 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.WebDriver 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.WebDriver in project gitblit by gitblit.
the class GitblitDashboardView method waitToLoadFor.
public synchronized void waitToLoadFor(int sec) {
WebDriverWait webDriverWait = new WebDriverWait(getDriver(), sec);
webDriverWait.until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver d) {
return d.getTitle().toLowerCase().startsWith(GitblitDashboardView.TITLE_STARTS_WITH);
}
});
}
use of org.openqa.selenium.WebDriver in project ORCID-Source by ORCID.
the class PublicClientTest method testAuthenticateIsTheOnlyScopeThatWorksForPublicClient.
@Test
public void testAuthenticateIsTheOnlyScopeThatWorksForPublicClient() throws JSONException, InterruptedException {
String clientId = getPublicClientId();
String clientRedirectUri = getPublicClientRedirectUri();
String userId = getUser1OrcidId();
String password = getUser1Password();
WebDriver webDriver = getWebDriver();
for (ScopePathType scope : ScopePathType.values()) {
if (ScopePathType.AUTHENTICATE.equals(scope)) {
String authCode = getAuthorizationCode(clientId, clientRedirectUri, scope.value(), userId, password, true);
assertFalse(PojoUtil.isEmpty(authCode));
} else {
String authorizationPageUrl = String.format(OauthAuthorizationPageHelper.authorizationScreenUrl, getWebBaseUrl(), clientId, scope.value(), clientRedirectUri);
webDriver.get(authorizationPageUrl);
String authCodeUrl = webDriver.getCurrentUrl();
assertFalse(PojoUtil.isEmpty(authCodeUrl));
assertTrue(authCodeUrl.contains("error=invalid_scope"));
}
}
}
use of org.openqa.selenium.WebDriver in project ORCID-Source by ORCID.
the class OauthAuthorizationPageHelper method clickAuthorizeOnAuthorizeScreen.
private static void clickAuthorizeOnAuthorizeScreen(final WebDriver webDriver) {
By userIdElementLocator = By.id("authorize");
(new WebDriverWait(webDriver, BBBUtil.TIMEOUT_SECONDS)).until(ExpectedConditions.presenceOfElementLocated(userIdElementLocator));
WebElement authorizeButton = webDriver.findElement(By.id("authorize"));
authorizeButton.click();
(new WebDriverWait(webDriver, BBBUtil.TIMEOUT_SECONDS)).until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver d) {
return d.getTitle().equals("ORCID Playground");
}
});
}
Aggregations