开发者

How to get the 'text' value return from 'Textbox'?

I am writing scripts using White for UI automation testing. I need to get the actual text value return from a'Textbox'.

I used the following line to search the TextBox first, the AutomationId ("vwSearched_Number") represent the actual text value (e.g. 123456). I want to get this text value (123456) returned to be used for next method. But the script failed with the error msg from Assert validation which means no 'SearchedNumber' value returned.

  TextBox SearchedNumber = MainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("vwSearched_Number"));

   Assert.IsNotNull(Searched开发者_JS百科Number, "SearchedNumber is not valid");


It appears that the MainWindow.Get() function is returning a TextBox.. so SearchedNumber.Text should get you what you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜