TestStack.White尝试自动查找文本框

时间:2014-07-09 19:07:12

标签: c# wpf automation

Code with errors here

我正在使用包装程序库TestStack.White以更简单的方式深入了解Windows自动化。我试图自动化一种在游戏启动器上输入用户名的方法。我不知道文本框名称,所以我尝试使用SearchCriteria方法来检索它。

由此我得到以下错误

  
      
  • 最佳重载方法匹配' TestStack.White.UIItems.Finders.SearchCriteria.AndControlType(System.Windows.Automation.ControlType)'   有一些无效的参数C:\ Users \ Steve \ Documents \ Visual Studio   2013 \ Projects \ SAML \ Mod Loader \ RunSA.xaml.cs 54 16

  •   
  • 参数1:无法转换为System.Type' to' System.Windows.Automation.ControlType' C:\用户\史蒂夫\文档\ Visual   Studio 2013 \ Projects \ SAML \ Mod Loader \ RunSA.xaml.cs 54 65

  •   

1 个答案:

答案 0 :(得分:1)

尝试使用

SearchCriteria.ByControlType(ControlType.Edit)