public class Query extends Object
| Constructor and Description |
|---|
Query(org.openqa.selenium.By defaultLocator) |
Query(org.openqa.selenium.By defaultLocator,
org.openqa.selenium.remote.RemoteWebDriver driver) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAlternateLocator(String browser,
org.openqa.selenium.By locator)
Specify a alternate locator for a specific browser.
|
io.appium.java_client.MobileElement |
findMobileElement()
This will return a MobileElement object if the supplied locator could find a valid MobileElement.
|
List<io.appium.java_client.MobileElement> |
findMobileElements()
This will return a list of MobileElement objects, it may be empty if the supplied locator does not match any elements on screen
|
org.openqa.selenium.support.ui.Select |
findSelectElement()
This will return a Select object if the supplied locator could find a valid WebElement.
|
org.openqa.selenium.WebElement |
findWebElement()
This will return a WebElement object if the supplied locator could find a valid WebElement.
|
List<org.openqa.selenium.WebElement> |
findWebElements()
This will return a list of WebElement objects, it may be empty if the supplied locator does not match any elements on screen
|
Query |
initQueryObject(org.openqa.selenium.remote.RemoteWebDriver driverObject)
Set a static driver object that wil be used for all instances of Query
|
org.openqa.selenium.By |
locator()
This will return the locator currently associated with your driver object.
|
public Query(org.openqa.selenium.By defaultLocator,
org.openqa.selenium.remote.RemoteWebDriver driver)
public Query(org.openqa.selenium.By defaultLocator)
public Query initQueryObject(org.openqa.selenium.remote.RemoteWebDriver driverObject)
driverObject - public void addAlternateLocator(String browser, org.openqa.selenium.By locator)
Any actions that use a By object will examine the `browserName` capability of the current driver, if it matches what you have specified here this locator will be used instead.
It is Suggested you pass in a org.openqa.selenium.remote.BrowserType field to ensure accuracy, example:
Query query = newQuery(By.id("foo"); query.addAlternateLocator(BrowserType.GOOGLECHROME, By.id("bar");
This is intentionally a String for future compatibility.
browser - String value matching a browsername capabilitylocator - A By object used for locating webElementspublic org.openqa.selenium.WebElement findWebElement()
public io.appium.java_client.MobileElement findMobileElement()
public List<org.openqa.selenium.WebElement> findWebElements()
public List<io.appium.java_client.MobileElement> findMobileElements()
public org.openqa.selenium.support.ui.Select findSelectElement()
public org.openqa.selenium.By locator()
Copyright © 2018. All rights reserved.