public class InBrowser extends Object
InBrowserSinglton
offers a simpler API.| Constructor and Description |
|---|
InBrowser(org.openqa.selenium.WebDriver driver)
Creates a connection to a browser, using the given driver
|
| Modifier and Type | Method and Description |
|---|---|
org.openqa.selenium.WebElement |
clickAt(Path el)
Click at the location the first element that fits the given path.
|
org.openqa.selenium.WebElement |
clickOn(Path el)
Click on the first element that fits the given path.
|
void |
doubleClickOn(Path el)
Doubleclick the location of the first element that fits the given path
|
Operations.DragAndDrop |
dragAndDrop(Path path)
Drag and drop in the browser.
|
org.openqa.selenium.WebElement |
find(Path el)
Finds an element in the browser, based on the xpath representing el.
|
List<org.openqa.selenium.WebElement> |
findAll(Path el)
Finds all elements in the browser, based on the xpath representing el.
|
org.openqa.selenium.WebElement |
findPageWithNumberOfOccurrences(Path el,
int numberOfOccurrences,
RelationOperator relationOperator)
Don't use this directly.
|
org.openqa.selenium.WebElement |
findPageWithout(Path el)
Finds an page in the browser, that does not contain the given path
|
org.openqa.selenium.WebDriver |
getDriver() |
org.openqa.selenium.WebElement |
hoverOver(Path el)
Hover over the location of the first element that fits the given path
|
boolean |
isDisplayed(Path el)
is the element present and displayed? Typically you should not use this method directly.
|
boolean |
isEnabled(Path el)
is the element present and enabled? Typically you should not use this method directly.
|
boolean |
isNotPresent(Path el)
is the element present? Typically you should not use this method directly.
|
boolean |
isPresent(Path el)
is the element present? Typically you should not use this method directly.
|
boolean |
isSelected(Path el)
is the element present and selected? Typically you should not use this method directly.
|
Integer |
numberOfAppearances(Path el)
Returns the number of elements in the browser that match the given path.
|
Operations.KeysDown |
pressKeyDown(CharSequence thekey)
Press key down in the browser, or on a specific element.
|
Operations.ReleaseKey |
releaseKey(CharSequence thekey)
Release key down in the browser, or on a specific element.
|
Operations.Scroll |
scroll()
scroll the browser.
|
Operations.ScrollElement |
scrollElement(Path wrapper) |
org.openqa.selenium.WebElement |
scrollTo(Path el)
Scroll to the location of the first element that fits the given path
|
Operations.KeysSender |
sendKeys(CharSequence... charsToSend)
send keys to the browser, or to a specific element.
|
public InBrowser(org.openqa.selenium.WebDriver driver)
driver - a WebDriver instancepublic org.openqa.selenium.WebDriver getDriver()
public org.openqa.selenium.WebElement find(Path el)
el - - the path to findpublic org.openqa.selenium.WebElement findPageWithNumberOfOccurrences(Path el, int numberOfOccurrences, RelationOperator relationOperator)
el - the path to findnumberOfOccurrences - the base number to findrelationOperator - whether we look for exactly the numberOfOccurrences, at least, or at most occurrencespublic org.openqa.selenium.WebElement findPageWithout(Path el)
el - - the path that must not appear in the pagepublic List<org.openqa.selenium.WebElement> findAll(Path el)
el - - the path to findpublic Integer numberOfAppearances(Path el)
el - the element to findpublic boolean isPresent(Path el)
el - the path to findpublic boolean isNotPresent(Path el)
el - the path to findpublic boolean isEnabled(Path el)
el - the elementpublic boolean isSelected(Path el)
el - the elementpublic boolean isDisplayed(Path el)
el - the elementpublic org.openqa.selenium.WebElement clickOn(Path el)
el - the elementpublic org.openqa.selenium.WebElement clickAt(Path el)
el - the elementpublic org.openqa.selenium.WebElement hoverOver(Path el)
el - the elementpublic org.openqa.selenium.WebElement scrollTo(Path el)
el - the elementpublic void doubleClickOn(Path el)
el - the elementpublic Operations.KeysSender sendKeys(CharSequence... charsToSend)
charsToSend - The characters to send. Can be "abc" or "a", "b", "c"public Operations.KeysDown pressKeyDown(CharSequence thekey)
thekey - a key to presspublic Operations.ReleaseKey releaseKey(CharSequence thekey)
browser.releaseKey(Keys.TAB).inBrowser();
browser.releaseKey(Keys.TAB).on(path);
thekey - a key to releasepublic Operations.Scroll scroll()
browser.scroll().to(path);
browser.scroll().left(50);
browser.scroll().right(50);
browser.scroll().up(50);
browser.scroll().down(50);
public Operations.ScrollElement scrollElement(Path wrapper)
public Operations.DragAndDrop dragAndDrop(Path path)
path - the source elementCopyright © 2018. All rights reserved.