回答
app.Query(c => c.Id("MonthValue").Text("11"))
應該這樣做
是的,但我必須得到這個值,因爲我可以通過+/-更改此值。 (c => c.Id(「MonthValue」)。getText()) –
AppResult有一個Text屬性,所以試試app.Query(c => c.Id ( 「MonthValue」))。文字。 https://developer.xamarin.com/api/property/Xamarin.UITest.Queries.AppResult.Text/ – JimBobBennett
只需使用查詢的Text
屬性:
app.Query(c => c.Id("MonthValue").Text
參考:https://developer.xamarin.com/api/property/Xamarin.UITest.Queries.AppResult.Text/
想要更新吉姆的回答。 app.Query返回一個數組,因此我們不能使用 app.Query(c => c.Id("MonthValue")).Text
作爲它自己。我們應該使用app.Query(c => c.Id("MonthValue"))[0].Text
例如
謝謝!它爲我工作索引[1] –
- 1. 如何獲得文本文件中的特定數據元素
- 2. 如何獲得特定元素在XML
- 3. 如何獲得特定元素在JSON
- 4. 我如何獲得測試VideoViewModel的上下文(Xamarin,NUnitLite)
- 5. 如何獲得文本元素TD DomXPath
- 6. 如何獲得獨特的元素?
- 7. 如何獲得特定項目的特定對象xamarin C#
- 8. 如何獲得的Django單元測試
- 9. UI測試失敗 - 未能獲得快照元素錯誤-25201
- 10. Xamarin UI測試確定平臺
- 11. 如何獲得具有特定值的數組的元素
- 12. Xamarin表單UI測試
- 13. 如何獲得一個特定的元素,同時與json_decode
- 14. 如何獲得R中列表的特定元素?
- 15. 如何獲得特定元素的列表數量?
- 16. 如何在mongoDB中獲得數組的特定元素?
- 17. 如何獲得特定節點之間的XML元素與LINQ
- 18. 如何獲得特定元素在XML或可變的XElement
- 19. j2me和ksoap如何獲得asp.net webservice中的特定元素
- 20. 如何獲得特定的數組元素PHP
- 21. 如何獲得jQuery.each循環中的特定元素
- 22. 如何獲得特定數組元素的總數?
- 23. 蟒蛇BeautifulSoup獲得特定元素
- 24. 獲得div元素與硒的文本
- 25. 如何獲取特定元素之前的類的元素數
- 26. jQuery的如何獲得span元素內的文本框的值
- 27. UI測試從uitableviewcell獲取文本
- 28. 如何獲得元素
- 29. 如何使用Xamarin UI測試找到具有自定義屬性的元素FWK
- 30. Xcode 7中的特定UI測試
我需要:「11」作爲字符串 –