use of org.openqa.selenium.TimeoutException in project chrome_page_performance_sqlite_java by sergueik.
the class ChromePagePerformanceUtilTest method testnavigateBaseURL.
@Ignore
@Test
public void testnavigateBaseURL() {
System.err.println("base URL loading test");
try {
driver.get(baseURL);
// Wait for page url to update
WebDriverWait wait = new WebDriverWait(driver, 20);
wait.pollingEvery(500, TimeUnit.MILLISECONDS);
ExpectedCondition<Boolean> urlChange = driver -> driver.getCurrentUrl().matches(String.format("^%s.*", baseURL));
wait.until(urlChange);
System.err.println("Current URL: " + driver.getCurrentUrl());
} catch (TimeoutException e) {
}
}
use of org.openqa.selenium.TimeoutException in project selenium_java by sergueik.
the class NgIgnoreSyncIntegrationTest method testNonAngular.
// @Ignore
@Test
public void testNonAngular() {
if (isCIBuild) {
return;
}
ngDriver.navigate().to("http://www.google.com");
try {
long startTime = System.currentTimeMillis();
ngDriver.waitForAngular();
// exception: window.angular is undefined
long estimatedTime = System.currentTimeMillis() - startTime;
System.err.println("waitForAngular: " + estimatedTime);
NgWebElement element = ngDriver.findElement(By.cssSelector("input#gs_htif0"));
element.getAttribute("id");
} catch (TimeoutException exception) {
System.err.println("TimeoutException thrown:");
rootCauseMessage = ExceptionUtils.getRootCauseMessage(exception);
System.err.println("Exception thrown: " + rootCauseMessage);
return;
}
}
use of org.openqa.selenium.TimeoutException in project selenium_java by sergueik.
the class AngularAndWebDriverTest method waitTests.
@SuppressWarnings("deprecation")
@Test(enabled = true)
public void waitTests() {
driver.get("http://juliemr.github.io/protractor-demo/");
ngWebDriver.waitForAngularRequestsToFinish();
driver.findElement(ByAngular.model("first")).sendKeys("40");
driver.findElement(ByAngular.model("second")).sendKeys("2");
driver.findElement(ByAngular.buttonText("Go!")).click();
By locator = ByAngular.exactBinding("latest");
WebDriverWait wait = new WebDriverWait(driver, 120);
wait.pollingEvery(1000, TimeUnit.MILLISECONDS);
try {
// should work
wait.until(ExpectedConditions.visibilityOfElementLocated(locator));
System.err.println("After wait");
} catch (TimeoutException e) {
System.err.println("Timeout Exception");
} catch (Exception e) {
System.err.println("Exception (ignored) " + e.toString());
}
try {
wait.until(new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver d) {
WebElement e = d.findElement(locator);
Boolean result = e.isDisplayed();
System.err.println("In apply: Element = " + e.getAttribute("outerHTML") + "\nresult = " + result.toString());
return result;
}
});
} catch (Exception e) {
System.err.println("Exception: " + e.toString());
// throw new RuntimeException(e);
}
try {
Thread.sleep(10000);
} catch (Exception e) {
}
}
use of org.openqa.selenium.TimeoutException in project blueocean-plugin by jenkinsci.
the class GitCreationPage method createPipelinePW.
public MultiBranchPipeline createPipelinePW(SSEClientRule sseCLient, String pipelineName, String url, String user, String pass) throws IOException {
jobApi.deletePipeline(pipelineName);
dashboardPage.clickNewPipelineBtn();
clickGitCreationOption();
wait.until(By.cssSelector("div.text-repository-url input")).sendKeys(url);
wait.until(By.xpath("//*[contains(text(), 'Jenkins needs a user credential')]"));
boolean createCredentialFound = false;
try {
wait.until(By.xpath("//*[contains(text(), 'Create new credential')]"));
createCredentialFound = true;
} catch (NoSuchElementException | TimeoutException | AcceptanceTestException e) {
// ignore it
}
if (createCredentialFound) {
driver.findElement(By.xpath("//*[contains(text(),'Create new credential')]")).click();
}
wait.until(By.cssSelector("div.text-username input")).sendKeys(user);
wait.until(By.cssSelector("div.text-password input")).sendKeys(pass);
wait.until(By.cssSelector(".button-create-credential")).click();
wait.until(By.xpath("//*[contains(text(), 'Use existing credential')]"));
logger.info("Created user/pass credential");
wait.until(By.cssSelector(".button-create-pipeline")).click();
logger.info("Click create pipeline button");
MultiBranchPipeline pipeline = null;
try {
pipeline = multiBranchPipelineFactory.pipeline(pipelineName);
String urlPart = pipeline.getUrl() + "/activity";
logger.info("waiting for urlPart: " + urlPart);
wait.until(ExpectedConditions.urlContains(urlPart), 30000);
sseCLient.untilEvents(SSEEvents.activityComplete(pipeline.getName()));
driver.navigate().refresh();
pipeline.getActivityPage().checkUrl();
return pipeline;
} finally {
deleteQuietly(pipeline, pipelineName);
}
}
use of org.openqa.selenium.TimeoutException in project jitsi-meet-torture by jitsi.
the class BreakoutRoomsTest method testCollapseRoom.
@Test(dependsOnMethods = { "testSendParticipantToRoom" })
public void testCollapseRoom() {
BreakoutRoomsList roomsList = participant1.getBreakoutRoomsList();
boolean visible = true;
// there should be one breakout room with one participant
TestUtils.waitForCondition(participant1.getDriver(), 5, (ExpectedCondition<Boolean>) d -> {
List<BreakoutRoomsList.BreakoutRoom> rooms = roomsList.getRooms();
return rooms.size() == 1 && rooms.get(0).getParticipantsCount() == 1;
});
// get id of the breakout room participant
String participant2Id = participant1.getDriver().findElement(By.id(BREAKOUT_ROOMS_LIST_ID)).findElements(By.className(LIST_ITEM_CONTAINER)).stream().filter(el -> !el.getAttribute("id").equals("")).findFirst().map(el -> el.getAttribute("id")).orElse("");
participant2Id = participant2Id.substring(PARTICIPANT_ITEM.length());
// check participant 2 is visible in the pane initially
TestUtils.waitForDisplayedElementByID(participant1.getDriver(), PARTICIPANT_ITEM + participant2Id, 5);
// collapse the first
roomsList.getRooms().get(0).collapse();
try {
TestUtils.waitForDisplayedElementByID(participant1.getDriver(), PARTICIPANT_ITEM + participant2Id, 3);
} catch (TimeoutException e) {
visible = false;
}
assertFalse(visible, "Participant 2 should no longer be visible");
// the collapsed room should still have one participant
TestUtils.waitForCondition(participant1.getDriver(), 5, (ExpectedCondition<Boolean>) d -> roomsList.getRooms().get(0).getParticipantsCount() == 1);
}
Aggregations