AppQuery Class

Definition

Fluent query API for specifying view elements to match for queries and gestures.

public class AppQuery : Xamarin.UITest.Queries.ITokenContainer, Xamarin.UITest.Utils.IFluentInterface
type AppQuery = class
    interface ITokenContainer
    interface IFluentInterface
Public Class AppQuery
Implements IFluentInterface, ITokenContainer
Inheritance
AppQuery
Implements

Constructors

AppQuery(AppQuery, Object[])

Constructor for adding more tokens to an existing query in an immutable fashion. Takes the tokens from the old query plus the additional tokens.

AppQuery(QueryPlatform)

Initial constructor for queries. Should not be called directly, but used as part of the fluent API in the app classes.

Properties

QueryPlatform

The target platform of the query. Useful when writing extensions methods for queries for platform differences.

Methods

All(String)

Changes the query to return all elements instead of just the visible ones.

Button(String)

Matches a button. For Android: An element that has class (or inherits from) android.widget.Button. For iOS: An element with class UIButton.

Child(Int32)

Changes the query to return the n'th child element of the currently matched ones.

Child(String)

Changes the query to return child elements of the currently matched ones.

Class(String)

Matches element class. For Android (no '.' in className): An element that has a class name of the given value (case insensitive). For Android ('.'s in className): An element which has a class (or super class) fully qualified name that matches the value. For iOS (first char lowercase): An element that has the class (or super class) name of the given value prepended with "UI". Example: button becomes UIButton. For iOS (first char uppercase): An element that has the class (or super class) name of the given value.

ClassFull(String)

Matches element class. For Android (no '.' in className): An element that has a class name of the given value (case insensitive). For Android ('.'s in className): An element which has a class (or super class) fully qualified name that matches the value. For iOS: An element that has the class (or super class) name of the given value.

Css(String)

Matches elements in web views matching the given css selector. Must be used on web view elements. If used alone, will default to android.webkit.WebView for Android and UIWebView for iOS.

Descendant(Int32)

Changes the query to return the n'th descendant element of the currently matched ones.

Descendant(String)

Changes the query to return descendant elements of the currently matched ones.

Frame(String)

Matches a Frame/IFrame, allowing subsequent Css queries to execute within that frame. Must be used on web view elements. If used alone, will default to android.webkit.WebView for Android and UIWebView for iOS.

Id(Int32)

Matches element id. For Android: An element with the given value as id. Allows properties of an Android App project's Resource.Id to be used in Id() queries. For iOS: An element with the string version of the given value as accessibilityIdentifier.

Id(String)

Matches element id. For Android: An element with the given value as id. For iOS: An element with the given value as accessibilityIdentifier.

Index(Int32)

Matches the nth element of the currently matched elements.

Invoke(String)

Invokes a method on the view elements matched by the query. Can be chained to invoke methods on the results.

Invoke(String, Object)

Invokes a method on the view elements matched by the query. Can be chained to invoke methods on the results.

Invoke(String, Object, Object)

Invokes a method on the view elements matched by the query. Can be chained to invoke methods on the results.

Invoke(String, Object, Object, Object)

Invokes a method on the view elements matched by the query. Can be chained to invoke methods on the results.

Invoke(String, Object, Object, Object, Object)

Invokes a method on the view elements matched by the query. Can be chained to invoke methods on the results.

Invoke(String, Object, Object, Object, Object, Object)

Invokes a method on the view elements matched by the query. Can be chained to invoke methods on the results.

InvokeJS(String)

Invokes javascript on the view elements matched by the query. If view elements other than WebViews are encountered, the execution will halt and an Exception will be thrown.

Marked(String)

Matches common values. For Android: An element with the given value as either id, contentDescription or text. For iOS: An element with the given value as either accessibilityLabel or accessibilityIdentifier.

Parent(Int32)

Changes the query to return the n'th parent element of the currently matched ones.

Parent(String)

Changes the query to return parent elements of the currently matched ones.

Property(String)

Allows for further filtering on a given property value.

Property(String, Boolean)

Matches a property or getter method value on the element.

Property(String, Int32)

Matches a property or getter method value on the element.

Property(String, String)

Matches a property or getter method value on the element.

Raw(String)

A raw Calabash selector. Allows for string based Calabash queries.

Raw(String, Object)

A raw Calabash selector. Allows for string based Calabash queries.

Raw(String, Object, Object)

A raw Calabash selector. Allows for string based Calabash queries.

Raw(String, Object, Object, Object)

A raw Calabash selector. Allows for string based Calabash queries.

Raw(String, Object, Object, Object, Object)

A raw Calabash selector. Allows for string based Calabash queries.

Raw(String, Object, Object, Object, Object, Object)

A raw Calabash selector. Allows for string based Calabash queries.

Raw(String, Object, Object, Object, Object, Object, Object)

A raw Calabash selector. Allows for string based Calabash queries.

Sibling(Int32)

Changes the query to return the n'th sibling element of the currently matched ones.

Sibling(String)

Changes the query to return sibling elements of the currently matched ones.

Switch(String)

Matches a Switch. For Android: An element that inherits from android.widget.CompoundButton. For iOS: An element with class UISwitch.

Text(String)

Matches element text.

TextField(String)

Matches a TextField. For Android: An element that has class (or inherits from) android.widget.EditText. For iOS: An element with class UITextField.

ToString()

Converts the string into it's Calabash query equivalent.

WebView()

Matches WebViews

WebView(Int32)

Matches the nth WebView

XPath(String)

Matches elements in web views matching the given XPath selector. Must be used on web view elements. If used alone, will default to android.webkit.WebView for Android and UIWebView for iOS.

Explicit Interface Implementations

IFluentInterface.GetType()
ITokenContainer.Tokens

Applies to