|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.test.ui.po.BaseElement
public class BaseElement
Represents all elements which include web pages as well as parts of web pages.
| Constructor Summary | |
|---|---|
BaseElement()
|
|
| Method Summary | |
|---|---|
Object |
executeJavascript(String javascript,
Object... arguments)
|
protected org.openqa.selenium.WebDriver |
getDriver()
|
protected static TestUtils |
getUtil()
|
void |
makeAlertDialogSilent()
|
void |
makeConfirmDialogSilent(boolean accept)
There is no easy support for alert/confirm window methods yet, see - http://code.google.com/p/selenium/issues/detail?id=27 - http://www.google.com/codesearch/p?hl=en#2tHw6m3DZzo/branches /merge/common/test/java/org/openqa/selenium/AlertsTest.java The aim is :
Alert alert = this.getDriver().switchTo().alert();
alert.accept();
Until then, the following hack does override the confirm method in Javascript to return the given value. |
void |
makeElementVisible(org.openqa.selenium.By locator)
Shows hidden elements, as if they would be shown on hover. |
void |
makeElementVisible(org.openqa.selenium.WebElement element)
|
static void |
setContext(PersistentTestContext context)
Used so that AllTests can set the persistent test context. |
void |
waitForNotificationErrorMessage(String message)
|
void |
waitForNotificationSuccessMessage(String message)
|
void |
waitForNotificationWarningMessage(String message)
|
void |
waitUntilElementDisappears(org.openqa.selenium.By locator)
Waits until the given element is either hidden or deleted. |
void |
waitUntilElementEndsWithAttributeValue(org.openqa.selenium.By locator,
String attributeName,
String expectedValue)
Waits until the given element ends with a certain value for an attribute. |
void |
waitUntilElementHasAttributeValue(org.openqa.selenium.By locator,
String attributeName,
String expectedValue)
Waits until the given element has a certain value for an attribute. |
void |
waitUntilElementHasTextContent(org.openqa.selenium.By locator,
String expectedValue)
Waits until the given element has a certain value as its inner text. |
void |
waitUntilElementIsVisible(org.openqa.selenium.By locator)
Wait until the element given by the locator is displayed. |
void |
waitUntilElementsAreVisible(org.openqa.selenium.By[] locators,
boolean all)
Wait until one or all of a array of element locators are displayed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BaseElement()
| Method Detail |
|---|
public static void setContext(PersistentTestContext context)
protected org.openqa.selenium.WebDriver getDriver()
protected static TestUtils getUtil()
public void waitUntilElementIsVisible(org.openqa.selenium.By locator)
locator - the locator for the element to look for.
public void waitUntilElementsAreVisible(org.openqa.selenium.By[] locators,
boolean all)
locators - the array of element locators to look for.all - if true then don't return until all elements are found. Otherwise return after finding one.public void waitUntilElementDisappears(org.openqa.selenium.By locator)
locator - public void makeElementVisible(org.openqa.selenium.By locator)
RuntimeException if the web driver does not support JavaScript or JavaScript is disabled.
locator - locator used to find the element, in case multiple elements are found, the first is usedpublic void makeElementVisible(org.openqa.selenium.WebElement element)
public void waitUntilElementHasAttributeValue(org.openqa.selenium.By locator,
String attributeName,
String expectedValue)
locator - the element to wait onattributeName - the name of the attribute to checkexpectedValue - the attribute value to wait for
public void waitUntilElementEndsWithAttributeValue(org.openqa.selenium.By locator,
String attributeName,
String expectedValue)
locator - the element to wait onattributeName - the name of the attribute to checkexpectedValue - the attribute value to wait for
public void waitUntilElementHasTextContent(org.openqa.selenium.By locator,
String expectedValue)
locator - the element to wait onexpectedValue - the content value to wait for
public Object executeJavascript(String javascript,
Object... arguments)
public void makeConfirmDialogSilent(boolean accept)
Alert alert = this.getDriver().switchTo().alert();
alert.accept();
Until then, the following hack does override the confirm method in Javascript to return the given value.
accept - true to accept the confirmation dialog, false to cancel itpublic void makeAlertDialogSilent()
makeConfirmDialogSilent(boolean)public void waitForNotificationErrorMessage(String message)
public void waitForNotificationWarningMessage(String message)
public void waitForNotificationSuccessMessage(String message)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||