UITestControl.GetProperty 方法
取得指定之屬性的值。
命名空間: Microsoft.VisualStudio.TestTools.UITesting
組件: Microsoft.VisualStudio.TestTools.UITesting (在 Microsoft.VisualStudio.TestTools.UITesting.dll 中)
語法
'宣告
Public Function GetProperty ( _
propertyName As String _
) As Object
public Object GetProperty(
string propertyName
)
public:
Object^ GetProperty(
String^ propertyName
)
member GetProperty :
propertyName:string -> Object
public function GetProperty(
propertyName : String
) : Object
參數
- propertyName
型別:System.String
要從中擷取值之屬性的名稱。
傳回值
型別:System.Object
型別為 Object 之指定屬性的值。Object 必須轉型為適當的資料型別。
備註
若要存取 UITestControl 的屬性,例如取得清單方塊中項目的計數,或在按鈕上設定文字,您必須使用 GetProperty 和 SetProperty 以取得並設定 UITestControl 的特定屬性。 propertyName 參數會指定要存取的屬性。
若要取得 HtmlList 中的項目計數,請將 GetProperty 與參數 ItemCount 一起使用。
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.VisualStudio.TestTools.UITesting 命名空間