WaitForControlExist超时问题 [英] WaitForControlExist timeout issue

查看:97
本文介绍了WaitForControlExist超时问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个运行应用程序并在该应用程序上打开一个窗口的测试。测试搜索错误对话框的帖子。为此,我使用以下代码

I am writing a test which runs an application and opens a window on that app. Post which the test searches for an Error dialog. For that I use the following code

WinWindow window = new WinWindow(mywindow);

WinWindow window = new WinWindow(mywindow);

   window.SearchProperties [WinWindow.PropertyNames。名称] ="错误";

  window.SearchProperties[WinWindow.PropertyNames.Name] = "Error";

if(window.WaitForControlExists(1000))

if( window.WaitForControlExists(1000) )

Assert.Fail(" Error");

Assert.Fail("Error");

我希望测试能够查找错误窗口以及是否发现报告失败。它会这样做,但是如果没有错误对话框那么需要很长时间才能实现,即使我将1秒作为超时。我的应用程序中的场景是错误
可能出现也可能不出现。我只想在出现错误对话框时报告失败。

I expect the test to look for the error window and if it finds report a failure. It does so but if the error dialog is not there it takes long time to come out of that, even though I give 1 second as timeout. The scenario in my application is that the error may or may not appear. I want to report failure only if error dialog appears.

 

推荐答案

WaitForControlExists()可以做隐式搜索不符合此处指定的timeOut的控件。将搜索超时(Playback.PlaybackSettings.SearchTimeout& Playback.PlaybackSettings.WaitForReadyTimeout)配置为较小的
值并重试。
WaitForControlExists() can do an implicit search for the control which does not honor the timeOut specified over here. Configure your search timeout (Playback.PlaybackSettings.SearchTimeout & Playback.PlaybackSettings.WaitForReadyTimeout) to a lesser value and retry.


这篇关于WaitForControlExist超时问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆