Package io.appium.java_client
Class AppiumBy
java.lang.Object
org.openqa.selenium.By
io.appium.java_client.AppiumBy
- All Implemented Interfaces:
org.openqa.selenium.By.Remotable
- Direct Known Subclasses:
AppiumBy.ByAccessibilityId,AppiumBy.ByAndroidDataMatcher,AppiumBy.ByAndroidUIAutomator,AppiumBy.ByAndroidViewMatcher,AppiumBy.ByAndroidViewTag,AppiumBy.ByClassName,AppiumBy.ByCustom,AppiumBy.ById,AppiumBy.ByImage,AppiumBy.ByIosClassChain,AppiumBy.ByIosNsPredicate,AppiumBy.ByName,AppiumBy.FlutterBy
public abstract class AppiumBy
extends org.openqa.selenium.By
implements org.openqa.selenium.By.Remotable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classNested classes/interfaces inherited from class org.openqa.selenium.By
org.openqa.selenium.By.ByCssSelector, org.openqa.selenium.By.ByLinkText, org.openqa.selenium.By.ByPartialLinkText, org.openqa.selenium.By.ByTagName, org.openqa.selenium.By.ByXPath, org.openqa.selenium.By.RemotableNested classes/interfaces inherited from interface org.openqa.selenium.By.Remotable
org.openqa.selenium.By.Remotable.Parameters -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.openqa.selenium.ByaccessibilityId(String accessibilityId) About Android accessibility https://developer.android.com/intl/ru/training/accessibility/accessible-app.html About iOS accessibility https://developer.apple.com/library/ios/documentation/UIKit/Reference/ UIAccessibilityIdentification_Protocol/index.htmlstatic org.openqa.selenium.ByandroidDataMatcher(String dataMatcherString) This locator strategy is only available in Espresso Driver mode.static org.openqa.selenium.ByandroidUIAutomator(String uiautomatorText) Refer to UI Automator .static org.openqa.selenium.ByandroidViewMatcher(String viewMatcherString) This locator strategy is only available in Espresso Driver mode.static org.openqa.selenium.ByandroidViewTag(String tag) This locator strategy is available in Espresso Driver mode.static org.openqa.selenium.ByFor IOS it is the full name of the XCUI element and begins with XCUIElementType.static org.openqa.selenium.ByThis type of locator requires the use of the 'customFindModules' capability and a separately-installed element finding plugin.org.openqa.selenium.WebElementfindElement(org.openqa.selenium.SearchContext context) List<org.openqa.selenium.WebElement>findElements(org.openqa.selenium.SearchContext context) static AppiumBy.FlutterByflutterAncestor(AppiumBy.FlutterBy of, AppiumBy.FlutterBy matching) This locator strategy is available in FlutterIntegration Driver mode since version 1.4.0.static AppiumBy.FlutterByflutterAncestor(AppiumBy.FlutterBy of, AppiumBy.FlutterBy matching, boolean matchRoot) This locator strategy is available in FlutterIntegration Driver mode since version 1.4.0.static AppiumBy.FlutterByflutterDescendant(AppiumBy.FlutterBy of, AppiumBy.FlutterBy matching) This locator strategy is available in FlutterIntegration Driver mode since version 1.4.0.static AppiumBy.FlutterByflutterDescendant(AppiumBy.FlutterBy of, AppiumBy.FlutterBy matching, boolean matchRoot, boolean skipOffstage) This locator strategy is available in FlutterIntegration Driver mode since version 1.4.0.static AppiumBy.FlutterByflutterKey(String selector) This locator strategy is available in FlutterIntegration Driver mode.static AppiumBy.FlutterByflutterSemanticsLabel(String semanticsLabel) This locator strategy is available in FlutterIntegration Driver mode.static AppiumBy.FlutterByflutterText(String selector) This locator strategy is available in FlutterIntegration Driver mode.static AppiumBy.FlutterByflutterTextContaining(String selector) This locator strategy is available in FlutterIntegration Driver mode.static AppiumBy.FlutterByflutterType(String selector) This locator strategy is available in FlutterIntegration Driver mode.static org.openqa.selenium.ByFor IOS the element name.static org.openqa.selenium.ByThis locator strategy is available only if OpenCV libraries and Node.js bindings are installed on the server machine.static org.openqa.selenium.ByiOSClassChain(String iOSClassChainString) This locator strategy is available in XCUITest Driver mode.static org.openqa.selenium.ByiOSNsPredicateString(String iOSNsPredicateString) This locator strategy is available in XCUITest Driver mode.static org.openqa.selenium.ByFor IOS the element name.toString()Methods inherited from class org.openqa.selenium.By
cssSelector, equals, getJavascriptExecutor, getWebDriver, hashCode, linkText, partialLinkText, tagName, xpathMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openqa.selenium.By.Remotable
getRemoteParameters
-
Constructor Details
-
AppiumBy
-
-
Method Details
-
findElements
- Specified by:
findElementsin classorg.openqa.selenium.By
-
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.SearchContext context) - Overrides:
findElementin classorg.openqa.selenium.By
-
toString
- Overrides:
toStringin classorg.openqa.selenium.By
-
accessibilityId
About Android accessibility https://developer.android.com/intl/ru/training/accessibility/accessible-app.html About iOS accessibility https://developer.apple.com/library/ios/documentation/UIKit/Reference/ UIAccessibilityIdentification_Protocol/index.html- Parameters:
accessibilityId- id is a convenient UI automation accessibility Id.- Returns:
- an instance of
AppiumBy.ByAndroidUIAutomator
-
androidDataMatcher
This locator strategy is only available in Espresso Driver mode.- Parameters:
dataMatcherString- is a valid json string detailing hamcrest matcher for Espresso onData(). See the documentation for more details- Returns:
- an instance of
AppiumBy.ByAndroidDataMatcher
-
androidUIAutomator
Refer to UI Automator .- Parameters:
uiautomatorText- is Android UIAutomator string- Returns:
- an instance of
AppiumBy.ByAndroidUIAutomator
-
androidViewMatcher
This locator strategy is only available in Espresso Driver mode.- Parameters:
viewMatcherString- is a valid json string detailing hamcrest matcher for Espresso onView(). See the documentation for more details- Returns:
- an instance of
AppiumBy.ByAndroidViewMatcher
-
androidViewTag
This locator strategy is available in Espresso Driver mode.- Parameters:
tag- is a view tag string- Returns:
- an instance of
AppiumBy.ByAndroidViewTag - Since:
- Appium 1.8.2 beta
-
className
For IOS it is the full name of the XCUI element and begins with XCUIElementType. For Android it is the full name of the UIAutomator2 class (e.g.: android.widget.TextView)- Parameters:
selector- the class name of the element- Returns:
- an instance of
AppiumBy.ByClassName
-
id
For IOS the element name. For Android it is the resource identifier.- Parameters:
selector- element id- Returns:
- an instance of
AppiumBy.ById
-
name
For IOS the element name. For Android it is the resource identifier.- Parameters:
selector- element id- Returns:
- an instance of
AppiumBy.ByName
-
custom
This type of locator requires the use of the 'customFindModules' capability and a separately-installed element finding plugin.- Parameters:
selector- selector to pass to the custom element finding plugin- Returns:
- an instance of
AppiumBy.ByCustom - Since:
- Appium 1.9.2
-
image
This locator strategy is available only if OpenCV libraries and Node.js bindings are installed on the server machine.- Parameters:
b64Template- base64-encoded template image string. Supported image formats are the same as for OpenCV library.- Returns:
- an instance of
AppiumBy.ByImage - Since:
- Appium 1.8.2
- See Also:
-
iOSClassChain
This locator strategy is available in XCUITest Driver mode.- Parameters:
iOSClassChainString- is a valid class chain locator string. See the documentation for more details- Returns:
- an instance of
AppiumBy.ByIosClassChain
-
iOSNsPredicateString
This locator strategy is available in XCUITest Driver mode.- Parameters:
iOSNsPredicateString- is an iOS NsPredicate String- Returns:
- an instance of
AppiumBy.ByIosNsPredicate
-
flutterKey
This locator strategy is available in FlutterIntegration Driver mode.- Parameters:
selector- is the value defined to the key attribute of the flutter element- Returns:
- an instance of
AppiumBy.ByFlutterKey
-
flutterType
This locator strategy is available in FlutterIntegration Driver mode.- Parameters:
selector- is the Type of widget mounted in the app tree- Returns:
- an instance of
AppiumBy.ByFlutterType
-
flutterText
This locator strategy is available in FlutterIntegration Driver mode.- Parameters:
selector- is the text that is present on the widget- Returns:
- an instance of
AppiumBy.ByFlutterText
-
flutterTextContaining
This locator strategy is available in FlutterIntegration Driver mode.- Parameters:
selector- is the text that is partially present on the widget- Returns:
- an instance of
AppiumBy.ByFlutterTextContaining
-
flutterSemanticsLabel
This locator strategy is available in FlutterIntegration Driver mode.- Parameters:
semanticsLabel- represents the value assigned to the label attribute of semantics element- Returns:
- an instance of
AppiumBy.ByFlutterSemanticsLabel
-
flutterDescendant
public static AppiumBy.FlutterBy flutterDescendant(AppiumBy.FlutterBy of, AppiumBy.FlutterBy matching, boolean matchRoot, boolean skipOffstage) This locator strategy is available in FlutterIntegration Driver mode since version 1.4.0.- Parameters:
of- represents the parent widget locatormatching- represents the descendant widget locator to matchmatchRoot- determines whether to include the root widget in the searchskipOffstage- determines whether to skip offstage widgets- Returns:
- an instance of
AppiumBy.ByFlutterDescendant
-
flutterDescendant
public static AppiumBy.FlutterBy flutterDescendant(AppiumBy.FlutterBy of, AppiumBy.FlutterBy matching) This locator strategy is available in FlutterIntegration Driver mode since version 1.4.0.- Parameters:
of- represents the parent widget locatormatching- represents the descendant widget locator to match- Returns:
- an instance of
AppiumBy.ByFlutterDescendant
-
flutterAncestor
public static AppiumBy.FlutterBy flutterAncestor(AppiumBy.FlutterBy of, AppiumBy.FlutterBy matching, boolean matchRoot) This locator strategy is available in FlutterIntegration Driver mode since version 1.4.0.- Parameters:
of- represents the child widget locatormatching- represents the ancestor widget locator to matchmatchRoot- determines whether to include the root widget in the search- Returns:
- an instance of
AppiumBy.ByFlutterAncestor
-
flutterAncestor
public static AppiumBy.FlutterBy flutterAncestor(AppiumBy.FlutterBy of, AppiumBy.FlutterBy matching) This locator strategy is available in FlutterIntegration Driver mode since version 1.4.0.- Parameters:
of- represents the child widget locatormatching- represents the ancestor widget locator to match- Returns:
- an instance of
AppiumBy.ByFlutterAncestor
-