For those of you not familiar with WinAppDriver, it is a UI automation service for Windows 10 that users can use to test their applications. We recently released our v1.1 preview that you can read more about here.
What is UI Recorder
For many in the WinAppDriver community, Inspect has been the most common tool for users to select UI elements and view their attribute data. Though Inspect serves its intended purpose of viewing accessibility data, it falls behind when it comes to supporting scenarios specifically for UI automation, such as being able to generate XPath queries.
For situations such as these, the WinAppDriver UI Recorder tool hopes to fill in the gaps from Inspect and serve as its alternative.
As for its initial release, the UI Recorder tool will enable the following two key scenarios:
1) Inspecting UI elements and retrieving their XPath expressions
2) Generating C# code for certain actions (mouse click) when “Record” is active
- Generated Code can be pasted into the UI Recorder Template folder for WinAppDriver playback
We’re hoping that with this tool, users will have a simpler and more intuitive approach in writing automation scripts for WinAppDriver.
Getting Started
The code for the UI Recorder is open-sourced and available on WinAppDriver’s GitHub repo here. It’s recommended to use Visual Studio 2017 to start building and compiling it. Once compiled, you can immediately start using UI Recorder.
In addition to access to the source, a zipped executable can be found here on our GitHub Releases section.
Using UI Recorder
The UI Recorder tool aims to provide an intuitive, and simplistic, user interface that is divided into two panels, as seen below:
UI Recorder tracks both keyboard and mouse interactions against an application interface—representing a UI action. When Recording is active, both the top and bottom panels are dynamically updated with varying UI element information every time a new UI action takes place. The Top Panel shows the generated XPath query of the currently selected UI element, and the Bottom Panel shows the raw XML information for the same element. You can navigate to the C# Code tab on the bottom panel to view generated C# code of the recorded action which you can use on a WinAppDriver test.
The following animation provides an example of the recording process:
The code recorded can be coped over to the clipboard and pasted onto the WinAppDriver UI Recorder template project to be replayed.
Providing Feedback
With the UI Recorder tool being open-source, we highly encourage the community to submit any PRs with changes or enhancements, and to post suggestions on how they would like to see the UI Recorder grow.
Please use the GitHub Issues Board to provide any feedback on the UI Recorder tool – we look forward to hearing about any suggestions, feature requests, or bug reports!
Staying Informed
To stay up to date with WinAppDriver news follow @mrhassanuz.
Summary
A new tool for WinAppDriver is available now: UI Recorder. Now users have an intuitive way automate UI with WinAppDriver by not only being able to generate XPath expressions on the fly, but also C# code from by recording UI action events through mouse clicks.