IApp 介面

定義

表示要與應用程式互動的主要閘道。 此介面包含 和 iOSApp 之間的 AndroidApp 共用功能。

public interface IApp
type IApp = interface
Public Interface IApp
衍生

屬性

Device

裝置資訊和控制

Print

包含用於輸出查詢結果的協助程式方法,而不是依賴 Console

TestServer

允許 HTTP 存取在裝置上執行的測試伺服器。

方法

Back()

在裝置上返回流覽。

ClearText()

清除目前焦點專案的文字。

ClearText(Func<AppQuery,AppQuery>)

從支援的相符專案清除文字。

ClearText(Func<AppQuery,AppWebQuery>)

從支援的相符專案清除文字。

ClearText(String)

從支援的相符專案清除文字。

DismissKeyboard()

如果存在,則會隱藏鍵盤

DoubleTap(Func<AppQuery,AppQuery>)

在相符的專案上執行兩個快速點選/觸控手勢。 如果符合多個元素,則會使用第一個專案。

DoubleTap(String)

在相符的專案上執行兩個快速點選/觸控手勢。 如果符合多個元素,則會使用第一個專案。

DoubleTapCoordinates(Single, Single)

在指定的座標上執行快速按兩下/觸控手勢。

DragAndDrop(Func<AppQuery,AppQuery>, Func<AppQuery,AppQuery>)

將 從 專案拖曳至 至 專案。

DragAndDrop(String, String)

將 從 專案拖曳至 至 專案。

DragCoordinates(Single, Single, Single, Single)

執行介於 2 點之間的連續拖曳手勢。

EnterText(Func<AppQuery,AppQuery>, String)

將文字輸入支援它的相符專案。

EnterText(Func<AppQuery,AppWebQuery>, String)

將文字輸入支援它的相符專案。

EnterText(String)

將文字輸入至目前焦點的專案。

EnterText(String, String)

將文字輸入支援它的相符專案。

Flash(Func<AppQuery,AppQuery>)

藉由閃爍來醒目提示查詢的結果。 使用 Fluent API 指定檢視專案。 預設為所有可見的檢視物件。

Flash(String)

藉由閃爍來醒目提示查詢的結果。 使用標示的字串指定檢視專案。

Invoke(String, Object)

針對 Android 和 iOS 的應用程式委派,在應用程式的主要活動上叫用 方法。 針對 Xamarin 應用程式,必須使用屬性公開方法,如下所示。

活動中的 Android 範例:

[Export]
public string MyInvokeMethod(string arg)
{
    return "uitest";
}

應用程式委派中的 iOS 範例:

[Export("myInvokeMethod:")]
public NSString MyInvokeMethod(NSString arg)
{
    return new NSString("uitest");
}
Invoke(String, Object[])

針對 Android 和 iOS 的應用程式委派,在應用程式的主要活動上叫用 方法。 針對 Xamarin 應用程式,必須使用屬性公開方法,如下所示。

活動中的 Android 範例:

[Export]
public string MyInvokeMethod(string arg, string arg2)
{
    return "uitest";
}

應用程式委派中的 iOS 範例:

[Export("myInvokeMethod:")]
public NSString MyInvokeMethod(NSString arg, NSString arg2)
{
    return new NSString("uitest");
}
PinchToZoomIn(Func<AppQuery,AppQuery>, Nullable<TimeSpan>)

在相符的元素上執行捏合手勢,以放大檢視。 如果符合多個元素,則會使用第一個專案。

PinchToZoomIn(String, Nullable<TimeSpan>)

在相符的元素上執行捏合手勢,以放大檢視。 如果符合多個元素,則會使用第一個專案。

PinchToZoomInCoordinates(Single, Single, Nullable<TimeSpan>)

執行捏合手勢,以在指定的座標上放大檢視。

PinchToZoomOut(Func<AppQuery,AppQuery>, Nullable<TimeSpan>)

在相符的元素上執行捏合手勢,以縮小檢視。如果符合多個元素,則會使用第一個專案。

PinchToZoomOut(String, Nullable<TimeSpan>)

在相符的元素上執行捏合手勢,以縮小檢視。如果符合多個元素,則會使用第一個專案。

PinchToZoomOutCoordinates(Single, Single, Nullable<TimeSpan>)

執行捏合手勢,以在指定的座標上放大檢視。

PressEnter()

按下應用程式中的 Enter 鍵。

PressVolumeDown()

按下裝置上的音量減少按鈕。

PressVolumeUp()

按下裝置上的音量向上按鈕。

Query(Func<AppQuery,AppQuery>)

查詢會使用 Fluent API 來檢視物件。 預設只會傳回可見的檢視物件。

Query(Func<AppQuery,AppWebQuery>)

使用 Fluent API 查詢 Web 檢視物件。 預設只會傳回可見的檢視物件。

Query(Func<AppQuery,InvokeJSAppQuery>)

使用 Fluent API 在檢視物件上叫用 JAVAscript。

Query(String)

查詢會使用 Fluent API 來檢視物件。 預設只會傳回可見的檢視物件。

Query<T>(Func<AppQuery,AppTypedSelector<T>>)

使用 Fluent API 查詢檢視物件的屬性。

Repl()

啟動互動式 REPL (Read-Eval-Print-Loop) 以進行應用程式探索,並暫停測試執行,直到關閉為止。

Screenshot(String)

取得應用程式目前狀態的螢幕擷取畫面。 這是用來表示 Xamarin Test Cloud 中的測試步驟。

ScrollDown(Func<AppQuery,AppQuery>, ScrollStrategy, Double, Int32, Boolean)

向下捲動第一個專案比對查詢。

ScrollDown(String, ScrollStrategy, Double, Int32, Boolean)

向下捲動第一個專案比對查詢。

ScrollDownTo(Func<AppQuery,AppQuery>, Func<AppQuery,AppQuery>, ScrollStrategy, Double, Int32, Boolean, Nullable<TimeSpan>)

向下捲動,直到畫面上顯示符合 toQuery 的專案為止。

ScrollDownTo(Func<AppQuery,AppWebQuery>, Func<AppQuery,AppQuery>, ScrollStrategy, Double, Int32, Boolean, Nullable<TimeSpan>)

向下捲動,直到畫面上顯示符合 toQuery 的專案為止。

ScrollDownTo(Func<AppQuery,AppWebQuery>, String, ScrollStrategy, Double, Int32, Boolean, Nullable<TimeSpan>)

向下捲動,直到畫面上顯示符合 toMarked 的專案為止。

ScrollDownTo(String, String, ScrollStrategy, Double, Int32, Boolean, Nullable<TimeSpan>)

向下捲動,直到畫面上顯示符合 toMarked 的專案為止。

ScrollTo(String, String, ScrollStrategy, Double, Int32, Boolean, Nullable<TimeSpan>)

捲動直到畫面上顯示符合 toMarked 的專案。

ScrollUp(Func<AppQuery,AppQuery>, ScrollStrategy, Double, Int32, Boolean)

在符合查詢的第一個專案上向上捲動。

ScrollUp(String, ScrollStrategy, Double, Int32, Boolean)

在符合查詢的第一個專案上向上捲動。

ScrollUpTo(Func<AppQuery,AppQuery>, Func<AppQuery,AppQuery>, ScrollStrategy, Double, Int32, Boolean, Nullable<TimeSpan>)

向上捲動,直到畫面上顯示符合 toQuery 的專案為止。

ScrollUpTo(Func<AppQuery,AppWebQuery>, Func<AppQuery,AppQuery>, ScrollStrategy, Double, Int32, Boolean, Nullable<TimeSpan>)

向上捲動,直到畫面上顯示符合 toQuery 的專案為止。

ScrollUpTo(Func<AppQuery,AppWebQuery>, String, ScrollStrategy, Double, Int32, Boolean, Nullable<TimeSpan>)

向上捲動,直到畫面上顯示符合 toMarked 的專案為止。

ScrollUpTo(String, String, ScrollStrategy, Double, Int32, Boolean, Nullable<TimeSpan>)

向上捲動,直到畫面上顯示符合 toMarked 的專案為止。

SetOrientationLandscape()

將裝置 (iOS) 或目前的活動 (Android) 方向變更為橫向模式。

SetOrientationPortrait()

將裝置 (iOS) 或 Android) 方向的目前活動 (變更為直向模式。

SetSliderValue(Func<AppQuery,AppQuery>, Double)

設定符合 query 的滑杆專案值。

SetSliderValue(String, Double)

設定符合 marked 的滑杆專案值。

SwipeLeftToRight(Double, Int32, Boolean)

執行由左至右撥動手勢。

SwipeLeftToRight(Func<AppQuery,AppQuery>, Double, Int32, Boolean)

在與 'query' 相符的專案上執行由左至右撥動手勢。

SwipeLeftToRight(Func<AppQuery,AppWebQuery>, Double, Int32, Boolean)

在與 'query' 相符的專案上執行由左至右撥動手勢。

SwipeLeftToRight(String, Double, Int32, Boolean)

在相符專案上執行由左至右撥動手勢。 如果符合多個元素,則會使用第一個專案。

SwipeRightToLeft(Double, Int32, Boolean)

執行由右至左撥動手勢。

SwipeRightToLeft(Func<AppQuery,AppQuery>, Double, Int32, Boolean)

在與 'query' 相符的專案上執行由右至左撥動手勢。

SwipeRightToLeft(Func<AppQuery,AppWebQuery>, Double, Int32, Boolean)

在與 'query' 相符的專案上執行由右至左撥動手勢。

SwipeRightToLeft(String, Double, Int32, Boolean)

在相符專案上執行由右至左撥動手勢。 如果符合多個元素,則會使用第一個專案。

Tap(Func<AppQuery,AppQuery>)

在相符的專案上執行點選/觸控手勢。 如果符合多個元素,則會使用第一個專案。

Tap(Func<AppQuery,AppWebQuery>)

在相符的專案上執行點選/觸控手勢。 如果符合多個元素,則會使用第一個專案。

Tap(String)

在相符的專案上執行點選/觸控手勢。 如果符合多個元素,則會使用第一個專案。

TapCoordinates(Single, Single)

在指定的座標上執行點選/觸控手勢。

TouchAndHold(Func<AppQuery,AppQuery>)

在相符的專案上執行連續觸控手勢。 如果符合多個元素,則會使用第一個專案。

TouchAndHold(String)

在相符的專案上執行連續觸控手勢。 如果符合多個元素,則會使用第一個專案。

TouchAndHoldCoordinates(Single, Single)

在指定的座標上執行連續觸控手勢。

WaitFor(Func<Boolean>, String, Nullable<TimeSpan>, Nullable<TimeSpan>, Nullable<TimeSpan>)

一般等候函式會重複呼叫 函式, predicate 直到函式傳 true 回 為止。 如果述詞未在時間限制內填滿,則會擲回 TimeoutException

WaitForElement(Func<AppQuery,AppQuery>, String, Nullable<TimeSpan>, Nullable<TimeSpan>, Nullable<TimeSpan>)

等候函式會重複查詢應用程式,直到找到相符的專案為止。 如果在時間限制內找不到任何專案,則會擲回 TimeoutException

WaitForElement(Func<AppQuery,AppWebQuery>, String, Nullable<TimeSpan>, Nullable<TimeSpan>, Nullable<TimeSpan>)

等候函式會重複查詢應用程式,直到找到相符的專案為止。 如果在時間限制內找不到任何專案,則會擲回 TimeoutException

WaitForElement(String, String, Nullable<TimeSpan>, Nullable<TimeSpan>, Nullable<TimeSpan>)

等候函式會重複查詢應用程式,直到找到相符的專案為止。 如果在時間限制內找不到任何專案,則會擲回 TimeoutException

WaitForNoElement(Func<AppQuery,AppQuery>, String, Nullable<TimeSpan>, Nullable<TimeSpan>, Nullable<TimeSpan>)

等候會重複查詢應用程式的函式,直到找不到相符的專案為止。 如果專案在時間限制結束時可見,則會擲回 TimeoutException

WaitForNoElement(Func<AppQuery,AppWebQuery>, String, Nullable<TimeSpan>, Nullable<TimeSpan>, Nullable<TimeSpan>)

等候會重複查詢應用程式的函式,直到找不到相符的專案為止。 如果專案在時間限制結束時可見,則會擲回 TimeoutException

WaitForNoElement(String, String, Nullable<TimeSpan>, Nullable<TimeSpan>, Nullable<TimeSpan>)

等候會重複查詢應用程式的函式,直到找不到相符的專案為止。 如果專案在時間限制結束時可見,則會擲回 TimeoutException

適用於