如何加快运行时间? [英] how to accelerate run time?

查看:108
本文介绍了如何加快运行时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


当我的脚本运行时,VS需要大约20秒才能找到一个对象。有没有办法加快这个时间?我正在运行一个for循环,在一个循环到另一个循环之间点击按钮或链接需要大约20秒,然后点击一个
弹出窗口打开,而VS再次等待20秒。我假设它正在寻找一个物体但是我可以用任何方式加速这个思考/等待时间吗?


thanls

解决方案

< blockquote>

检查%TEMP%\ UITestLogs目录中错误日志中的时间戳。您可以了解搜索或操作是否花费了大部分时间。


如果是动作,则播放可能正在等待控件进入"准备好"状态。在它可以采取行动之前的状态。您可以在Playback.PlaybackSettings中关闭WaitForReady(注意事项:它有时会导致意外故障)。


如果搜索需要花费很多时间,请检查哪个控件花了很多时间来搜索。可能搜索条件不够好,它回退到SkipIntermediateElements并重试搜索。搜索条件可能是
需要进行优化。


 


查看此帖子以获取相关信息:


http://social.msdn.microsoft.com/Forums/en-US/vsautotest/thread/3013bfdc-d600-4212-9cb1-6e21a448be84


 


hi,

when my script is running it takes around 20 seconds for VS to find an object. is there a way to accelerate this time? i'm running a for loop and between one loop to the other it takes around 20 seconds to click button or link and than after the click a pop up window open and than VS again waits for 20 seconds. i assuming it's looking for an object but any way can i accelerate this think/wait time?

thanls

解决方案

Check the timestamps in the error logs in the %TEMP%\UITestLogs directory. You can get an idea on whether the search or action is taking major chunk of the time.

If it is action, Playback might be waiting for the control to come to "ready" state before it can act on it. You can turn off WaitForReady in the Playback.PlaybackSettings, (a note of caution: it can sometimes lead to unexpected failures).

If it is search that is taking a lot of time, check which control is taking a lot of time to search. Probably the search condition is not good enough and it is falling back to SkipIntermediateElements and retrying the search. The search condition probably needs to be refined then.

 

Check this post for some related info:

http://social.msdn.microsoft.com/Forums/en-US/vsautotest/thread/3013bfdc-d600-4212-9cb1-6e21a448be84

 


这篇关于如何加快运行时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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