Coded UI Tests - Clicking button does suddenly not work

六月ゝ 毕业季﹏ 提交于 2019-12-25 18:49:15

问题


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.

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?


回答1:


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

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

You can refer to this.

Cheers.



来源:https://stackoverflow.com/questions/12347637/coded-ui-tests-clicking-button-does-suddenly-not-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!