断言在已编码的UI测试中关闭窗口 [英] Assert windows closed in Coded UI Tests

查看:32
本文介绍了断言在已编码的UI测试中关闭窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为WPF项目开发一组编码的UI测试。有谁知道如何断言窗口已关闭?窗口消失后,我似乎无法检查其任何属性。我应该断言UI元素是否为空?

I'm developing a set of coded UI tests for a WPF project. Does anyone know how to assert that a window was closed? I can't seem to check any properties of the window after it is gone. Should I assert the UI element is null, maybe?

推荐答案

UITestControl 类中有一个叫做 WaitForControlNotExist 的方法可以达到目的!

The UITestControl class has a method called WaitForControlNotExist that did the trick!

这篇关于断言在已编码的UI测试中关闭窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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