List of usage examples for org.openqa.selenium WebDriverException getMessage
@Override
public String getMessage()
From source file:org.kurento.test.client.KurentoTestClient.java
License:Open Source License
public void addTestName(String testName) { try {/*from w ww . j a v a 2 s .co m*/ browserClient.executeScript("addTestName('" + testName + "');"); } catch (WebDriverException we) { log.warn(we.getMessage()); } }
From source file:org.kurento.test.client.KurentoTestClient.java
License:Open Source License
public void appendStringToTitle(String webRtcMode) { try {//from ww w . ja v a 2 s. co m browserClient.executeScript("appendStringToTitle('" + webRtcMode + "');"); } catch (WebDriverException we) { log.warn(we.getMessage()); } }
From source file:org.nuxeo.functionaltests.Locator.java
License:Apache License
/** * Forces a click on an element, to workaround non-effective clicks in miscellaneous situations, after having * scrolled to it.//from ww w . j av a2 s . c om * * @param executor the javascript executor, usually {@link WebDriver} * @param element the element to scroll to * @return true if element is clickable * @since 8.3 */ public static final boolean scrollAndForceClick(WebElement element) { JavascriptExecutor executor = (JavascriptExecutor) AbstractTest.driver; scrollToElement(element); try { // forced click to workaround non-effective clicks in miscellaneous situations executor.executeScript("arguments[0].click();", element); return true; } catch (WebDriverException e) { if (e.getMessage().contains("Element is not clickable at point")) { log.debug("Element is not clickable yet"); return false; } throw e; } }
From source file:org.openqa.grid.e2e.node.CrashWhenStartingBrowserTest.java
License:Apache License
@Test public void serverCrashesStartingFirefox() throws MalformedURLException { WebDriverException exception = null; try {/*from w ww. ja va2s.c om*/ DesiredCapabilities ff = DesiredCapabilities.firefox(); WebDriver driver = new RemoteWebDriver(new URL(hub.getUrl() + "/wd/hub"), ff); } catch (WebDriverException expected) { exception = expected; } Assert.assertNotNull(exception); Assert.assertTrue(exception.getMessage().contains(wrong_path)); Assert.assertEquals(hub.getRegistry().getActiveSessions().size(), 0, "resource released"); }
From source file:org.openqa.selendroid.nativetests.NativeChildElementFindingTest.java
License:Apache License
@Test public void testShouldNotBeAbleTofindChildElementByXpath() throws Exception { openStartActivity();//from w ww.ja va2s .c o m try { driver.findElement(By.xpath("//a[@id='waitingButtonTest']")); Assert.fail("Finding Native elements by css selector is not supported."); } catch (WebDriverException e) { Assert.assertTrue(e.getMessage().contains("By locator ByXPath is curently not supported!")); } }
From source file:org.openqa.selendroid.nativetests.NativeChildElementFindingTest.java
License:Apache License
@Test public void testShouldNotBeAbleTofindChildElementByCssSelector() throws Exception { openStartActivity();/*from w w w. j a va 2s.c o m*/ WebElement rootElement = driver.findElement(By.id("l10n")); try { rootElement.findElement(By.cssSelector("button[id='waitingButtonTest']")); Assert.fail("Finding Native elements by css selector is not supported."); } catch (WebDriverException e) { Assert.assertTrue(e.getMessage().contains("By locator ByCssSelector is curently not supported!")); } }
From source file:org.openqa.selendroid.nativetests.NativeChildElementFindingTest.java
License:Apache License
@Test public void testShouldNotBeAbleTofindChildElementsByXpath() throws Exception { openStartActivity();/*w w w . j av a2 s .com*/ WebElement rootElement = driver.findElement(By.id("l10n")); try { rootElement.findElements(By.xpath("//button[id='waitingButtonTest']")); Assert.fail("Finding Native elements by css selector is not supported."); } catch (WebDriverException e) { Assert.assertTrue(e.getMessage().contains("By locator ByXPath is curently not supported!")); } }
From source file:org.openqa.selendroid.nativetests.NativeChildElementFindingTest.java
License:Apache License
@Test public void testShouldNotBeAbleTofindChildElementsByCssSelector() throws Exception { openStartActivity();/* w w w . j ava 2 s . c o m*/ WebElement rootElement = driver.findElement(By.id("l10n")); try { rootElement.findElements(By.cssSelector("button[id='waitingButtonTest']")); Assert.fail("Finding Native elements by css selector is not supported."); } catch (WebDriverException e) { Assert.assertTrue(e.getMessage().contains("By locator ByCssSelector is curently not supported!")); } }
From source file:org.openqa.selendroid.nativetests.NativeElementFindingTest.java
License:Apache License
@Test public void testShouldNotBeAbleTofindElementByXpath() throws Exception { openStartActivity();//w w w.j a v a2 s . c o m try { driver.findElement(By.xpath("//a[@id='waitingButtonTest']")); Assert.fail("Finding Native elements by css selector is not supported."); } catch (WebDriverException e) { Assert.assertTrue(e.getMessage().contains("By locator ByXPath is curently not supported!")); } }
From source file:org.openqa.selendroid.nativetests.NativeElementFindingTest.java
License:Apache License
@Test public void testShouldNotBeAbleTofindElementByCssSelector() throws Exception { openStartActivity();/*from ww w. ja v a2s . co m*/ try { driver.findElement(By.cssSelector("button[id='linkId']")); Assert.fail("Finding Native elements by css selector is not supported."); } catch (WebDriverException e) { Assert.assertTrue(e.getMessage().contains("By locator ByCssSelector is curently not supported!")); } }