搜索意外窗口时提高性能 [英] Improve Performance while searching for unexpected window

查看:94
本文介绍了搜索意外窗口时提高性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用一个工作流程,在播放期间我几乎没有意外的窗口。所以,我现在通过在执行操作之前进行检查即UItestControl.Exists来处理意外的窗口。


但是Exists属性需要花费很多时间(比我的更多)工作流程的执行时间)。如何更快地检查存在?


如果控件存在,则立即找到它。但是如果它不是那么,它需要花费大量的时间来告知控件不存在。


以前我使用的是AutomationElement,它非常快。我需要将性能至少与我的旧方法(即AutomationElement)相等,即使使用CUIT也是如此。


注意:我的意外窗口大部分是最大化时间和前景时间。


等待回复。


谢谢


Sumanth


 


 

解决方案

您好


你可以缩短搜索时间,看看它是否适合您。但请记住在.Exist调用之后恢复SearchTimeout值。



 Playback.PlaybackSettings.SearchTimeout = // somevalue in mille sec 



谢谢



 



 


悉达多


Hi,

I am having a workflow in which i get few unexpected window during playback. So, i am presently handling the unexpected window by having a check i.e. UItestControl.Exists before doing the action.

But Exists property is taking a lot of time(more than my execution time of workflow) . How can i make the check for existence faster?

If the control Exists, then it finds it immediately. But if it is not then it is taking a lot of time to inform that control does not exist.

Previously i was using AutomationElement and it was very fast. I need to have the performance atleast equal to my old approach(i.e. AutomationElement) even with CUIT.

Note: My unexpected window is most of the times in maximized and foreground one.

Waiting for the reply.

Thanks

Sumanth

 

 

解决方案

Hi

You can reduce the search time out and see if that works for you. But please remember to revert back the SearchTimeout value after .Exist call.

Playback.PlaybackSettings.SearchTimeout = //somevalue in mille sec

Thanks

 

 

Siddhartha


这篇关于搜索意外窗口时提高性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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