use of org.openqa.selenium.TimeoutException in project selenium-tests by Wikia.
the class ChatPage method isMessageOnChat.
public boolean isMessageOnChat(String message) {
try {
WebElement userPostedMessage = userPostedMessage(message);
wait.forElementVisible(userPostedMessage);
return true;
} catch (TimeoutException | NoSuchElementException ex) {
PageObjectLogging.log("Message on chat not displayed", ex, true);
return false;
}
}
use of org.openqa.selenium.TimeoutException in project acceptance-test-harness by jenkinsci.
the class LocalController method diagnose.
@Override
public void diagnose(Throwable cause) {
if (cause instanceof TimeoutException) {
FailureDiagnostics diagnostics = injector.getInstance(FailureDiagnostics.class);
String td = getThreaddump();
if (td != null) {
diagnostics.write("threaddump.log", td);
}
}
if (getenv("INTERACTIVE") != null && getenv("INTERACTIVE").equals("true")) {
if (cause instanceof MultipleFailureException) {
System.out.println("Multiple exceptions occurred:");
for (Throwable c : ((MultipleFailureException) cause).getFailures()) {
out.println();
c.printStackTrace(out);
out.println();
}
} else {
cause.printStackTrace(out);
}
out.println("Commencing interactive debugging. Browser session was kept open.");
synchronized (this) {
try {
this.wait();
} catch (InterruptedException e) {
return;
}
}
}
}
use of org.openqa.selenium.TimeoutException in project acceptance-test-harness by jenkinsci.
the class DiskUsage method reloaded.
public static Matcher<DiskUsage> reloaded() {
return new Matcher<DiskUsage>("disk usage reloaded") {
private Exception cause;
@Override
public boolean matchesSafely(DiskUsage item) {
JenkinsLogger logger = item.getJenkins().getLogger("all");
try {
logger.waitForLogged(Pattern.compile("Finished Project disk usage. \\d+ ms"));
return true;
} catch (TimeoutException ex) {
// v0.22 and newer
cause = ex;
}
try {
logger.waitForLogged(Pattern.compile("Finished Calculation of builds disk usage.*"));
logger.waitForLogged(Pattern.compile("Finished Calculation of job directories.*"));
logger.waitForLogged(Pattern.compile("Finished Calculation of workspace usage.*"));
return true;
} catch (TimeoutException ex) {
cause = ex;
return false;
}
}
@Override
public void describeMismatchSafely(DiskUsage item, Description dsc) {
dsc.appendText(cause.getMessage());
}
};
}
use of org.openqa.selenium.TimeoutException in project ORCID-Source by ORCID.
the class BlackBoxBase method adminUnlockAccount.
public void adminUnlockAccount(String adminUserName, String adminPassword, String orcidToUnlock) {
// Login Admin
adminSignIn(adminUserName, adminPassword);
try {
// Unlock the account
(new WebDriverWait(webDriver, BBBUtil.TIMEOUT_SECONDS, BBBUtil.SLEEP_MILLISECONDS)).until(BBBUtil.angularHasFinishedProcessing());
(new WebDriverWait(webDriver, BBBUtil.TIMEOUT_SECONDS)).until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@id='unlockProfileDiv']/p[1]/a[2]")));
BBBUtil.ngAwareClick(webDriver.findElement(By.xpath("//div[@id='unlockProfileDiv']/p[1]/a[2]")), webDriver);
(new WebDriverWait(webDriver, BBBUtil.TIMEOUT_SECONDS, BBBUtil.SLEEP_MILLISECONDS)).until(BBBUtil.angularHasFinishedProcessing());
WebElement unLockProfileOrcidId = webDriver.findElement(By.id("orcid_to_unlock"));
unLockProfileOrcidId.sendKeys(orcidToUnlock);
(new WebDriverWait(webDriver, BBBUtil.TIMEOUT_SECONDS, BBBUtil.SLEEP_MILLISECONDS)).until(BBBUtil.angularHasFinishedProcessing());
(new WebDriverWait(webDriver, BBBUtil.TIMEOUT_SECONDS)).until(ExpectedConditions.visibilityOfElementLocated(By.id("bottom-confirm-unlock-profile")));
BBBUtil.ngAwareClick(webDriver.findElement(By.id("bottom-confirm-unlock-profile")), webDriver);
(new WebDriverWait(webDriver, BBBUtil.TIMEOUT_SECONDS, BBBUtil.SLEEP_MILLISECONDS)).until(BBBUtil.angularHasFinishedProcessing());
(new WebDriverWait(webDriver, BBBUtil.TIMEOUT_SECONDS)).until(ExpectedConditions.visibilityOfElementLocated(By.id("btn-unlock")));
BBBUtil.ngAwareClick(webDriver.findElement(By.id("btn-unlock")), webDriver);
(new WebDriverWait(webDriver, BBBUtil.TIMEOUT_SECONDS, BBBUtil.SLEEP_MILLISECONDS)).until(BBBUtil.angularHasFinishedProcessing());
} catch (TimeoutException t) {
// Account might be already unlocked
}
}
use of org.openqa.selenium.TimeoutException in project ORCID-Source by ORCID.
the class OauthAuthorizationPageHelper method clickAuthorizeOnAuthorizeScreen.
public static void clickAuthorizeOnAuthorizeScreen(final WebDriver webDriver, boolean longLife) {
if (webDriver.getTitle().equals("ORCID Playground")) {
return;
} else {
try {
BBBUtil.extremeWaitFor(ExpectedConditions.presenceOfElementLocated(By.xpath("//p[contains(text(),'has asked for the following access to your ORCID Record')]")), webDriver);
if (longLife == false) {
// disablePersistentToken
WebElement persistentElement = webDriver.findElement(By.id("enablePersistentToken"));
if (persistentElement.isDisplayed()) {
if (persistentElement.isSelected()) {
persistentElement.click();
}
}
}
WebElement authorizeButton = webDriver.findElement(By.id("authorize"));
authorizeButton.click();
} catch (TimeoutException e) {
// It might be the case that we are already in the ORCID Playground page, so, lets check for that case
(new WebDriverWait(webDriver, BBBUtil.TIMEOUT_SECONDS)).until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver d) {
return d.getTitle().equals("ORCID Playground");
}
});
}
}
}
Aggregations