编码的UI测试-单击按钮突然不起作用 [英] Coded UI Tests - Clicking button does suddenly not work

查看:126
本文介绍了编码的UI测试-单击按钮突然不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WinForms应用程序的编码UI测试。在我的开发人员计算机(Windows 7)上运行测试工作正常,但是在每晚运行测试的测试代理上,单击工具栏按钮第三次(!)单击失败。该按钮将在应用程序中打开一个新窗口(在其他多个测试中,它会先执行两次)。查看正在执行的测试,好像鼠标悬停在按钮上,测试日志报告该按钮已被单击,但是测试失败,因为它找不到该按钮应打开的窗口。

I have a Coded UI test for a WinForms application. Running the test on my developer computer (Windows 7) works fine, but on the test agent running tests nightly clicking a toolbar button fails the third (!) time it is being clicked in the test. The button opens a new window in the application (which it does the first 2 times an in multiple other tests). Looking at the test executing it seems like the mouse hoovers over the button, the test log reports that the button was clicked, but the test then fails because it cannot find the window the button should open.

我正在寻找什么是我需要知道的可能导致此行为的编码UI测试中的已知问题或类似问题?

What I am looking for is any known issues or similar in Coded UI tests which I need to know of possible to cause this behavior?

推荐答案

我认为由于分辨率的变化或您的测试第三次无法找到按钮的记录位置。

I think Due to resolution changes or something your test is not able to find the recorded position of the button third time.

我建议您可以使用 GetClickablePoint()方法搜索按钮,而不管其在屏幕上的位置。

I would suggest you to use GetClickablePoint() method to search for a button irrespective of its position on the screen.

您可以请参阅这个。

干杯。

这篇关于编码的UI测试-单击按钮突然不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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