编码的UI等待控制就绪状态 [英] Coded UI Wait for control ready state

查看:65
本文介绍了编码的UI等待控制就绪状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在为使用Coded UI和telerik测试框架的WPF应用程序进行UI自动化。我随机地面临着在控制上执行点击操作等问题。它表示无法执行点击操作。


在我的应用程序中,代码已用于等待控件处于就绪状态:


public static void WaitForControl (UITestControl控件,bool continueOnError = false)

        {

           试试
            {

                Playback.PlaybackSettings.WaitForReadyLevel =   WaitForReadyLevel.AllThreads;

                 control.WaitForControlEnabled();

                Playback.PlaybackSettings.WaitForReadyLevel =   WaitForReadyLevel.UIThreadOnly;

            }
            catch(例外情况)

            {

                if(!continueOnError)

                {

                   抛出新的异常($"从ControlWaitHelper     控制名称:{control.ToString()} {EX}");

  &NBSP ;             }
            }
        }


大部分时间它都有效但随机失败。


请让我知道其他任何解决方案我们可以在UI上等待控件启用状态。



谢谢,


Rina






解决方案

喜丽娜,


感谢您张贴在这里。


我不确定telerik测试框架产品是否会导致问题,您可以在他们的网站上查询问题。


https:// www .telerik.com / download-trial-file / v2 / telerik-testing-framework


关于使用Microsoft技术实现辅助功能和GUI自动化。您可以张贴

就在这里。


最好的问候,


Hart



Hi,

I am doing UI automation for WPF application where using Coded UI and telerik testing framework. I am randomly facing issue like performing click operation on control. It says cannot perform the click operation.

In my application below code has been used to wait for a control to be in ready state:

public static void WaitForControl(UITestControl control, bool continueOnError = false)
        {
            try
            {
                Playback.PlaybackSettings.WaitForReadyLevel =   WaitForReadyLevel.AllThreads;
                control.WaitForControlEnabled();
                Playback.PlaybackSettings.WaitForReadyLevel =   WaitForReadyLevel.UIThreadOnly;
            }
            catch (Exception ex)
            {
                if (!continueOnError)
                {
                    throw new Exception($"From ControlWaitHelper.       Control Name:{control.ToString()} {ex}");
                }
            }
        }

Most of the time it works but randomly it fails.

Please let me know it there any other solution where we can wait for control enabled state on UI.

Thanks,

Rina

解决方案

Hi Rina,

Thank you for posting here.

I am not sure whether the telerik testing framework product cause the issue, you can consult the issue on their website.

https://www.telerik.com/download-trial-file/v2/telerik-testing-framework

About using Microsoft technologies to enable accessibility and GUI automation. You can post on here.

Best Regards,

Hart


这篇关于编码的UI等待控制就绪状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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