i am trying to automate the gui in c# .Is this same as browser automation .how can i start ui automation
-
2Please rephrase the question. – Bobby Jan 20 '10 at 11:33
-
2Do you actually mean UI *animation*? Or perhaps you are trying implement automation for testing the UI? Please add some more details. – Ash Jan 20 '10 at 11:35
-
Possible duplicate (but not yet fully answered): http://stackoverflow.com/questions/2052915/whats-a-good-if-any-net-windows-automation-library – Abel Jan 20 '10 at 11:40
7 Answers
If you are using WPF, Microsoft has a very detailed UI Automation library.
http://msdn.microsoft.com/en-us/library/ms747327.aspx
I had a look around but I couldn't find an equivalent for WinForms.

- 19,423
- 9
- 68
- 97
-
Very interesting, I didn't know about this. There are some 3rd party testing tools that allow for some UI automation with Winforms, Ranorex ( http://www.ranorex.com ) is one. – Tim Jarvis Jan 20 '10 at 12:02
You can use Microsoft's UI Automation library, but it isn't much fun. "White" is a better alternative... see: http://www.codeplex.com/white
EDIT:
New url to "White" project as it was moved to TestStack on GitHub: https://github.com/TestStack/White

- 55
- 14

- 5,634
- 8
- 45
- 58
-
2why is it better? isn't it dead? (I don't see any updates after version 0.21) – Elad Katz Aug 28 '12 at 15:52
-
Tests written using Microsoft's UI Automation library are verbose, less so with White. And I don't think it's dead, it just does what 99% of people want it to do. No point in code churn just to make a project seem alive... – Nat Ritmeyer Aug 29 '12 at 16:12
-
1if what i'm doing is not about testing but more about hooking to other windows for automation purposes, and my code is rather generic (i need to support many different applications) then White wouldn't be a good choice, would it? As far as I understand it, UIA is more generic and therefor verbose, whereas White is using more easier to understand and read syntax, but is less attuned to creating generic code? – Elad Katz Aug 31 '12 at 20:31
FlaUI is a good alternative to "White" library, based on native UI Automation libraries from Microsoft.

- 1,319
- 15
- 26
-
1FlaUI guy told me that they have even tested the framework with DevExpress controls as well. – Apoorv Nov 14 '19 at 02:24
9 Years later Appium is a good option, also a reference side from Microsoft, since CodedUI is obsolet. Microsoft build the WinAppDriver for Appium. You can also just use the WinAppDriver to test your gui. you need Appium, just if you want to do contionouos integration.
Differences:
Teststack.White is an efficient Testframework. It doens´t need as much time as WinAppDriver (Appium) to go through the tests and its very easy to implement in your testproject. But the support isn´t as good as WinAppDriver. Teststack.White as example still doesn´t support UWP (maybe no one want to develope with UWP :P ). On the other side, you need Windows 10 or Windows Server 2016 to work with the WinAppDriver. Both have an easy implementation of tests, but you need to set some JSON-Values, to get a http-connection with the WinAppDriver.
At least the WinAppDriver with Appium has much more possibilities, but TestStack.White is easy implemented.

- 23
- 6
-
-
-
Yes. It worked. Need to enable few settings to have complete control on the Automation. And DevExpress Support also helps in that – Apoorv Jul 06 '20 at 13:19
-
Be careful if your GUI is using any 3rd party Windows controls, like Devexpress controls, or Telerik controls.
MS UI Automation would have difficulties to locate those fancy grids, lovely menus and pretty icons.
Talking about TestStack.White, it's using MS UI Automation as the cornerstone, so it would face the same problem locating detailed GUI elements.
You will know when you need to manipulate the grid by row but UI Automation or TestStack.White could furthest only return you the table object, then you will find your R&D efforts before the project starts were all wasted. That's how I learned that lesson, but now I am the expert.

- 96
- 10
-
Hi, My WPF application is using DevExpress controls. What tool do you suggest for UI automation? – Apoorv Nov 12 '19 at 12:45
-
For the grid as an example, we developed an extra helper function in the application(Devexpress side), which: 1.gives back column names 2.select row by (column name, value) By doing this, we bridged the gap between our automated testing requirement and the capability MS UI Automation could provide. We did the same for other complex controls, like tree structures, graphical tabs, Icon stripes and etc. The way the test scripts call the 'helper' functions, we used COM. Obviously, for Winform program or WPM program, COM is an easier way to do inter-process communications. – Richard Nov 13 '19 at 21:43
-
can you share a sample that has DevExpress Grid implemented if possible? I want to look into the implementation as I am very very new to this. Just wanted to know what is the effort and is it worth? – Apoorv Nov 14 '19 at 02:23
-
Sorry, I don't know how our developers coded the extra helper in the application under test. Effort wise, the product owner needs to agree to plant extra code in their software, which to me is an immediate effort escalation. If scale the effort from mild, medium, heavy, then medium effort I would say. – Richard Nov 14 '19 at 04:25
-
The support to DevExpress was the last piece of the jigsaw of the whole test automation framework for our Windows app. It was worthy of our situation. We had been spending a whole year developing automated tests using the framework which patched the DevExpress support. And the tests brought great values to the business. Without the Devexpress patch we developed, the POC would have failed and there won't be following up work around that area. – Richard Jan 06 '20 at 21:14
-
possible to share the POC you did. I am still finding it difficult to do the stuff here – Apoorv Jan 13 '20 at 03:32
-
-
Thanks :) Seems like DevExpress has an added support for getting the visible rows using UIA automation by Microsoft. I am looking for a FlaUI equivalent now. https://www.devexpress.com/Support/Center/Question/Details/T546814/using-ui-automation-to-test-data-grid – Apoorv Jan 25 '20 at 21:02
-
http://msdn.microsoft.com/en-us/library/ms747327.aspx like Alastair Pitts pointed out can be used. From my knowledge it should be good for any automation tasks - as long as Windows recognizes the control your application uses as standard controls or controls that have automation support. Which should be the case for just about all major control vendors. And defnitely MFC, Win32, WinForms and probably WPF and Silverlight as well.
You can get an idea of what you are up to (against) by firing up Spy++ and having a look at what it displays.
You might also want to listen to the other ideas, using Tools like White (opensource) or Rannorex (which is commercial).

- 7,961
- 10
- 50
- 104