use of org.openqa.selenium.ElementClickInterceptedException in project selenium_cdp by sergueik.
the class ExceptionListenerDevToolsTest method test4.
// see also: https://qna.habr.com/q/1089060
@Test
public void test4() {
element = driver.findElement(By.cssSelector("#js-link-box-en"));
String blinkTitlescrpit = "var titleState = 0; setInterval(() => { " + " document.title = titleState ? \"blinking\" : \"title\"; titleState = " + " titleState ? 0 : 1; } , 500 );";
addOnClick(element, blinkTitlescrpit + "return false;");
try {
element.click();
} catch (ElementClickInterceptedException e) {
System.err.println("Exception(ignored) " + e.toString());
}
Utils.sleep(3000);
}
use of org.openqa.selenium.ElementClickInterceptedException in project selenium_cdp by sergueik.
the class ExceptionListenerDevToolsTest method test3.
// NOTE: the var titleState is intentionally not declared
// to trigger
// java.util.ConcurrentModificationException
// is the @After method printing exceptions
// presumably because new exceptions are thrown
// when setInterval is handler is called
@Test
public void test3() {
element = driver.findElement(By.cssSelector("#js-link-box-en"));
String blinkTitlescrpit = "setInterval(() => { " + " document.title = titleState? \"blinking\" : \"title\"; titleState = " + " titleState ? 0 : 1 ; } , 500 );";
addOnClick(element, blinkTitlescrpit + "return false;");
try {
element.click();
} catch (ElementClickInterceptedException e) {
System.err.println("Exception(ignored) " + e.toString());
}
Utils.sleep(3000);
}
use of org.openqa.selenium.ElementClickInterceptedException in project zeppelin by apache.
the class AbstractZeppelinIT method clickAndWait.
protected void clickAndWait(final By locator) {
WebElement element = pollingWait(locator, MAX_IMPLICIT_WAIT);
try {
element.click();
ZeppelinITUtils.sleep(1000, false);
} catch (ElementClickInterceptedException e) {
// if the previous click did not happened mean the element is behind another clickable element
Actions action = new Actions(driver);
action.moveToElement(element).click().build().perform();
ZeppelinITUtils.sleep(1500, false);
}
}
use of org.openqa.selenium.ElementClickInterceptedException in project selenium_java by sergueik.
the class ChromeSettingsTest method test3.
@Test
public void test3() {
Assume.assumeTrue(browserChecker.testingChrome());
urlLocator = "#basicPage > settings-section[page-title=\"Default browser\"]";
shadowLocator = "settings-default-browser-page";
shadow2Locator = "div#canBeDefaultBrowser";
driver.navigate().to(baseUrl);
element = shadowDriver.findElement(urlLocator);
System.err.println(String.format("outerHTML: %s", element.getAttribute("outerHTML")));
try {
/*
*
* actions.moveToElement(element).build().perform(); sleep(1000);
* actions.click().build().perform(); sleep(1000);
*/
element.click();
sleep(1000);
} catch (ElementClickInterceptedException e) {
System.err.println("Exception (ignored): " + e.getMessage());
// element click intercepted: Element is not clickable at point
}
// anything! - does not work either
try {
WebElement element2 = shadowDriver.findElement(element, shadowLocator);
assertThat(element2, notNullValue());
WebElement element3 = shadowDriver.findElement(element2, shadow2Locator);
assertThat(element3, notNullValue());
} catch (ElementNotVisibleException e) {
System.err.println("Exception (ignored): " + e.getMessage());
// Element with CSS settings-default-browser-page is not present on screen
}
}
use of org.openqa.selenium.ElementClickInterceptedException in project primefaces by primefaces.
the class ConfirmDialog001Test method assertDialog.
private void assertDialog(Page page, boolean visible) {
ConfirmDialog dialog = page.dialog;
Assertions.assertEquals(visible, dialog.isVisible());
if (visible) {
try {
// modal dialog should block clickability of button
page.confirm.click();
Assertions.fail("Button should not be clickable because modal mask is covering it!");
} catch (ElementClickInterceptedException ex) {
// element should be blocked by modal mask!
} catch (WebDriverException ex) {
// Safari: element should be blocked by modal mask!
}
} else {
assertClickable(page.confirm);
assertClickable(page.delete);
}
assertConfiguration(dialog.getWidgetConfiguration());
}
Aggregations