White UIAutomation click() stops working on different platform

折月煮酒 提交于 2019-12-04 09:46:33

I'm not sure if this is your problem or not, but I've noticed that White has a few issues when it is used by applications built using the AnyCPU platform and run on an 64-bit system. For some reason, anytime it attempts to move the mouse under these conditions, it automatically pushes the mouse to the bottom of the screen instead of the requested location. This means a click command misses the button it was told to click on.

If you build the automation application as an x86 application, White automates the mouse properly.

At my local windows 7 x64 machine it does the same.

Don't know if it's usefull, but using button.RaiseClickEvent(); seems to work ok. I assume this raises the event without clicking the button or smt.

I know this is an old question, but I bumped into it the other day and thought my answer might be useful to others...

I'm running Project White with NUnit on a 64-bit Win7 machine. To make it work for me I had to ensure that the tests were run in a 32-bit process.

I was using the TestDriven.Net plugin. It has an option to run Any CPU tests as either 32-bit or 64-bit.

As Harry mentioned in his answer, forcing the automation application (test application) in x86 mode does work.

However, the real problem is created by White itself. On White's discussion pages on codeplex, Hachima posted a modification of the source code of White to ensure it works under x86 as well as x64: http://white.codeplex.com/discussions/228433

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