为什么Coded Ui的执行速度非常慢

编程入门 行业动态 更新时间:2024-10-09 15:22:44
本文介绍了为什么Coded Ui的执行速度非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

为什么Coded Ui执行速度非常慢

Why Coded Ui execution is very slow

推荐答案

您好SrikarReddy,

Hi SrikarReddy,

欢迎来到MSDN论坛。

Welcome to MSDN forum.

经过研究,我发现 适当答案以提高执行时间,请参考以下答案代码:

After research, I found an appropriate answer to boost execution time, please refer the below code from the answer:

[CodedUITest] public class CodedUITest1 { [TestInitialize] public void TestInit() { // Call a common routine to set up the test MyCodedUITests.StartTest(); } [TestMethod] public void CodedUITestMethod1() { // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. this.UIMap.RecordedMethod1(); } } class MyCodedUITests { /// <summary> Test startup. </summary> public static void StartTest() { // Configure the playback engine Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled; //allows the test to run at full speed. Playback.PlaybackSettings.MaximumRetryCount = 10; //wair for loading page then response Playback.PlaybackSettings.ShouldSearchFailFast = false; //set full timeout to load page Playback.PlaybackSettings.DelayBetweenActions = 500; //the delay time between the UI actions Playback.PlaybackSettings.SearchTimeout = 1000; //the dafault is 3min // Add the error handler Playback.PlaybackError -= Playback_PlaybackError; // Remove the handler if it's already added Playback.PlaybackError += Playback_PlaybackError; // Ta dah... } /// <summary> PlaybackError event handler. </summary> private static void Playback_PlaybackError(object sender, PlaybackErrorEventArgs e) { // Wait a second System.Threading.Thread.Sleep(1000); // Retry the failed test operation e.Result = PlaybackErrorOptions.Retry; } }

在我身边进行实验后,执行时间缩短了。

After the experiment in my side, the execution time is reduced.

预计会有任何反馈。

最诚挚的问候,

Dylan

更多推荐

为什么Coded Ui的执行速度非常慢

本文发布于:2023-11-27 18:04:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639033.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:速度   Coded   Ui

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!