<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://doc.expecco.de/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lv</id>
	<title>expecco Wiki (Version 25.x) - Benutzerbeiträge [de]</title>
	<link rel="self" type="application/atom+xml" href="https://doc.expecco.de/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lv"/>
	<link rel="alternate" type="text/html" href="https://doc.expecco.de/wiki/Spezial:Beitr%C3%A4ge/Lv"/>
	<updated>2026-04-26T00:57:46Z</updated>
	<subtitle>Benutzerbeiträge</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11492</id>
		<title>WindowsAutomation Reference 2.0</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11492"/>
		<updated>2018-06-04T07:59:23Z</updated>

		<summary type="html">&lt;p&gt;Lv: /* Preparing a remote system for test exeuction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the documentation for the Windows Automation 2.0 plugin.&lt;br /&gt;
&lt;br /&gt;
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
*Automated GUI testing of WPF, WinForms, and Win32 applications.&lt;br /&gt;
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.&lt;br /&gt;
*Parallel remote test-execution on multiple systems.&lt;br /&gt;
*Performs tests against already built executables. No source code changes / recompilation of the application is required.&lt;br /&gt;
*Access to GUI components using XPath locators.&lt;br /&gt;
*Access objects of the application live at execution time.&lt;br /&gt;
*Full access to keyboard and mouse of the target system.&lt;br /&gt;
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...&lt;br /&gt;
&lt;br /&gt;
=Installation and Connection=&lt;br /&gt;
The WindowsAutomation testing plugin uses the expecoo &amp;quot;.NET-Bridge&amp;quot; which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
On the machine running the system under test:&lt;br /&gt;
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.&lt;br /&gt;
* One of the following operation systems:&lt;br /&gt;
::- Windows 7 SP1&lt;br /&gt;
::- Windows 8&lt;br /&gt;
::- Windows 8.1&lt;br /&gt;
::- Windows 10&lt;br /&gt;
&lt;br /&gt;
::- Windows Server 2008 R2 SP1&lt;br /&gt;
::- Windows Server 2012&lt;br /&gt;
::- Windows Server 2012 R2&lt;br /&gt;
::- Windows Server 2016&lt;br /&gt;
::- Windows Server, version 1709&lt;br /&gt;
&lt;br /&gt;
==Plugin Components==&lt;br /&gt;
The plugin consists of the following parts:&lt;br /&gt;
* The GUI Browser, used to interactively explore your application.&lt;br /&gt;
* The Windows Automation Library, which provides blocks that you can use in your test cases.&lt;br /&gt;
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.&lt;br /&gt;
&lt;br /&gt;
==Installing and Configuring the Plugin in Expecco==&lt;br /&gt;
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the &amp;quot;plugin&amp;quot; subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Preparing a local system for test execution==&lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Everything should work out of the box.&lt;br /&gt;
&lt;br /&gt;
TODO: Is that still true with the gui browser?&lt;br /&gt;
TODO: Pictures for the connection process&lt;br /&gt;
&lt;br /&gt;
==Preparing a remote system for test exeuction==&lt;br /&gt;
The remote system will have to run the &amp;quot;.Net-Bridge server&amp;quot; which in turn connects to expecco. &lt;br /&gt;
You just need to copy &amp;quot;DotNetBridgeServer.exe&amp;quot; to the computer your system under test is running on. No further installation is needed.&lt;br /&gt;
&lt;br /&gt;
To start the bridge, navigate to the executable in a shell and start it with the following arguments:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Arguments !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| -s || Yes || Tells the executable to run in server mode (as opposed to client mode).&lt;br /&gt;
|-&lt;br /&gt;
| -k || Yes || Tells the client to keep the connection open after aconnection has been terminated. This saves you the hassle to restart it every time a test finishes.&lt;br /&gt;
|-&lt;br /&gt;
| -a &amp;lt;ip/hostname&amp;gt;|| Yes || The IP-Address of the PC your application is running on.&lt;br /&gt;
|-&lt;br /&gt;
| -p &amp;lt;int&amp;gt; || No || The port the server should listen on (default is 34318).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
TODO: What settings does the plugin have?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GUI Browser=&lt;br /&gt;
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description also see [[Expecco GUI Tests Extension Reference|Gui Browser]].&lt;br /&gt;
&lt;br /&gt;
=Library=&lt;br /&gt;
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.&lt;br /&gt;
&lt;br /&gt;
== Connecting to an Application ==&lt;br /&gt;
To automate an application, you first have to connect to it. You can do this with the&lt;br /&gt;
blocks from the &#039;&#039;&#039;Connecting&#039;&#039;&#039; group.&lt;br /&gt;
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library&#039;s Connection Blocks.]]&lt;br /&gt;
&lt;br /&gt;
You can connect to an application by its &#039;&#039;&#039;executable name&#039;&#039;&#039;, or by its &#039;&#039;&#039;process id&#039;&#039;&#039;. &lt;br /&gt;
If you use the executable name, expecco will attach to the main process of the specified executable. Be careful as this is not necessarily the process &lt;br /&gt;
drawing the GUI! Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.&lt;br /&gt;
All connection blocks also require you to specify a &#039;&#039;&#039;name&#039;&#039;&#039; by which the connection should be known in future.&lt;br /&gt;
This is needed for when you automate multiple applications at the same time and need to change&lt;br /&gt;
&#039;&#039;&#039;connection contexts&#039;&#039;&#039; during test execution.&lt;br /&gt;
Please note that the application to connect to has to be started before the corresponding connection block is executed.&lt;br /&gt;
You can change in context of which connection a block is executed with the &#039;&#039;&#039;Set Active Connection&#039;&#039;&#039; block.&lt;br /&gt;
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Local Connection === &lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Just use the &#039;&#039;&#039;Create Local Connection&#039;&#039;&#039; with the mentioned above parameters.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Remote Connection ===&lt;br /&gt;
Make sure that the DotNet Bridge server is started as explained in [[#Preparing a remote system for test exeuction]]&lt;br /&gt;
When the bridge is running, you can connect to it with the &#039;&#039;&#039;Create Remote Connection&#039;&#039;&#039; block using the hostname and IP-Address you specified when you started the bridge.&lt;br /&gt;
&lt;br /&gt;
=== Closing a Connection ===&lt;br /&gt;
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.&lt;br /&gt;
One simple way to do this is to setup your connections in the &#039;&#039;&#039;Before Execution&#039;&#039;&#039; part of the test suite&lt;br /&gt;
and put the &#039;&#039;&#039;Close All Connections&#039;&#039;&#039; block in the &#039;&#039;&#039;After exeuction&#039;&#039;&#039; part.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Accessing GUI Elements ==&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library&#039;s GUI Element Access Blocks.]]&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksExamples.PNG|frame|A Few Examples on How to Access Elements in Notepad.]]&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksModes.PNG|frame|Different Ways to Reference a GUI Element.]]&lt;br /&gt;
All Windows applications are built as a &#039;&#039;&#039; tree&#039;&#039;&#039;  of &#039;&#039;&#039; GUI elements&#039;&#039;&#039; .&lt;br /&gt;
Some elements act as container of other element - their children. Tables, for example, are containers&lt;br /&gt;
for their cell elements which themselves might contain text labels.&lt;br /&gt;
At the root of the tree are one or more &#039;&#039;&#039;windows&#039;&#039;&#039; . When you connect to an application, you get access to&lt;br /&gt;
all windows at the tree&#039;s root.&lt;br /&gt;
To manipulate any of the system under test&#039;s GUI element, you first have to gain access to it.&lt;br /&gt;
The group &#039;&#039;&#039;GUI Element Access&#039;&#039;&#039;  provides blocks that help you to gain access to the elements. There are 12 blocks in total, divided between &#039;&#039;&#039; Access By XPath&#039;&#039;&#039; , &#039;&#039;&#039;Access By Property&#039;&#039;&#039;,&lt;br /&gt;
and &#039;&#039;&#039;Existence Test&#039;&#039;&#039;. For each category, blocks with the same interface exist. The only difference is the method of retrival.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Element : returns a &#039;&#039;&#039;single&#039;&#039;&#039; GUI Element matching the search condition. If multiple match the condition, an &#039;&#039;&#039;arbitrary&#039;&#039;&#039; element matching the condition is returned.&lt;br /&gt;
:If you want to make sure that there is only one element matching, set &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039;  to true. You can also enforce this globally by setting the environment variable &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039; in your environment. &lt;br /&gt;
:If ensureExclusive is set and more than one element is found, the block will fail and notify you of the ambiguity. This is disabled by default as checking for uniqueness is a very costly operation.&lt;br /&gt;
:You can also specify a &#039;&#039;&#039;timeout&#039;&#039;&#039; after which the search is aborted. This is useful if you know an element should be there soon but might currently be loading.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Elements: returns &#039;&#039;&#039;all&#039;&#039;&#039; GUI Element matching the search condition. If no element is found, it returns an empty list &amp;lt;b&amp;gt; Timeout &amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;cacheXPath&amp;lt;/b&amp;gt; are also applicable.&lt;br /&gt;
&lt;br /&gt;
;Exists: Works exactly the same as &#039;&#039;&#039;Get GUI Element&#039;&#039;&#039; but does not fail if no element can be found. Additionally provides an output pin specifying if an element has been found.&lt;br /&gt;
&lt;br /&gt;
Both of these blocks are also available in the &#039;&#039;&#039;Relative To Anchor&#039;&#039;&#039; variety. Those blocks also take a GUI Element as &#039;&#039;&#039;anchor&#039;&#039;&#039; in relation to which they search. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Using XPaths ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;XPath&#039;&#039;&#039; is the query language this plugin uses for selecting GUI elements in the application&#039;s element tree.&lt;br /&gt;
You can find the XPath of an element with the [[Expecco GUI Tests Extension Reference|Gui Browser]] or with third-party applications like Inspect.exe [https://msdn.microsoft.com/en-us/library/dd318521(v=vs.85).aspx] or FlaUInspect [https://github.com/FlauTech/FlaUInspect].&lt;br /&gt;
An &#039;&#039;&#039;XPath&#039;&#039;&#039; for the scroll button on the &lt;br /&gt;
vertical scrollbar in the german Windows Notepad application looks like this:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;]/Document[@Name=&#039;Text-Editor&#039;]/ScrollBar[@Name=&#039;Vertikale Bildlaufleiste&#039;]/Button[@Name=&#039;Bildlauf nach unten&#039;] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each level in the GUI tree, a new &amp;lt;b&amp;gt;Location Step&amp;lt;/b&amp;gt; containing the child elements &amp;lt;b&amp;gt;Control Type&amp;lt;/b&amp;gt; has to be added.&lt;br /&gt;
You do not have to use any predicates, the following XPath is valid as well:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window/Document/ScrollBar/Button &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but might lead to issues as there might be multiple GUI Elements matching this path.&lt;br /&gt;
You can select by three predicates that can be mixed and matched in the same query:&lt;br /&gt;
&lt;br /&gt;
; Name: the name the application developer has given an element. Be careful as this name might change during programm execution (See for example Notepad&#039;s window name which always begins with the name of the currently opened file.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
; AutomationId: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced.&lt;br /&gt;
: Many developersleave the ID empty or reuse it, making it useless. You should nontheless use this ID wherever applicable as it is static&lt;br /&gt;
: and meant for this exact purpose.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;List Index: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[last()] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please Note&#039;&#039;&#039;: You can &#039;&#039;&#039;only&#039;&#039;&#039; use the three predicates above in your XPaths. Other predicates &#039;&#039;&#039;DO NOT&#039;&#039;&#039; work! If you want to search&lt;br /&gt;
an element by another property (e.g. its help text), use the &#039;&#039;&#039;By Property&#039;&#039;&#039; variant of the block instead. If the property is not unique,&lt;br /&gt;
you can select a unique ancestor of the target by property or XPath relative to which the property is unique.&lt;br /&gt;
You can then use that ancestor as anchor in the &#039;&#039;&#039;Get GUI Element By Property (Relative to Anchor)&#039;&#039;&#039; block.&lt;br /&gt;
&lt;br /&gt;
=== Using Wildcards in XPaths ===&lt;br /&gt;
&lt;br /&gt;
XPath also supports &#039;&#039;&#039;wildcards&#039;&#039;&#039;. You can:&lt;br /&gt;
* replace &#039;&#039;&#039;one tree level&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard: &lt;br /&gt;
&amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;]/*/Button[1]&amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/*/*/*/Button[1] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace a &#039;&#039;&#039;control type&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;/Window/*[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace &#039;&#039;&#039;an arbitrary amount of tree levels&#039;&#039;&#039; with a &amp;quot;//&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;//Button &amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/Window//Button[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Especially the last option is useful as it makes your tests &amp;lt;b&amp;gt;more readable&amp;lt;/b&amp;gt; as the reader can easily focus on the relevant parts of the xpath.&lt;br /&gt;
But be careful. Using wildcards comes at a steep &amp;lt;b&amp;gt;performance cost&amp;lt;/b&amp;gt;. If your tests run unacceptably slow, first try to &#039;&#039;&#039;remove wildcards where they are not needed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Using Properties===&lt;br /&gt;
&lt;br /&gt;
You can also search for elements by property by specifying a value an element&#039;s property with the given name must have. For a list of properties a GUI element might have, take a look at Microsoft&#039;s documentation [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]. It specifies the supported properties for each pattern an element can support.&lt;br /&gt;
&lt;br /&gt;
=== XPath Resolution in Action Blocks ===&lt;br /&gt;
&lt;br /&gt;
Getting a reference to the GUI Element everytime you need to manipulate it in any way can make for very unclean looking test suites as two blocks are needed to perform any action - one for getting a reference to the element and another one for perform the action. The library therefore also allows you to directly feed an xpath into every block that would take a reference to a GUI Element.&lt;br /&gt;
&lt;br /&gt;
The image on the right shows this mode in action. Variants 1 and 2 are functionally equivalent.&lt;br /&gt;
While Variant 2 is more concise, Variant 1 is the right choice in most cases. While it has an additional block, you have control over the other input parameters. &lt;br /&gt;
You also can recycle the GUI element reference as seen in 3). This is invaluable as the XPath only has to be resolved once. This speeds up test execution by a lot as XPath resolution is very expensive operation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rule of thumb&#039;&#039;&#039;: Always use Variant 1 except if you need the reference to the GUI element only once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Interacting with GUI Elements ==&lt;br /&gt;
Once you retrieved a GUI element, you can interact with it by making use of the library&#039;s blocks located in the groups &#039;&#039;&#039;Elements&#039;&#039;&#039;, &#039;&#039;&#039;Patterns&#039;&#039;&#039;, and &#039;&#039;&#039;Properties&#039;&#039;&#039;. &lt;br /&gt;
Blocks in those categories take a GUI Element (and sometimes additional data) as input and manipulate it or query for its properties in some way.&lt;br /&gt;
&lt;br /&gt;
[[Bild:WindowsAutomation_Library_ElementsPatternsProperties.png|frame|The Library&#039;s Blocks for Interacting With Elements.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The &#039;Elements&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
This group contains blocks that are applicable to blocks that only work on &#039;&#039;&#039;GUI elements of a specific type&#039;&#039;&#039;. For a block&#039;s detailed description with examples ,&lt;br /&gt;
take a look at the block&#039;s documentation in expecco.&lt;br /&gt;
&lt;br /&gt;
Even though not only Checkboxes can be &#039;checked&#039;, the &#039;&#039;&#039;Check&#039;&#039;&#039; block in the &#039;&#039;&#039;Checkbox group&#039;&#039;&#039; only works for checkboxes and not e.g. for radio buttons. &lt;br /&gt;
Because of this limitation there are not that many blocks targeting specific elements. Most blocks target a specific &#039;&#039;&#039;pattern&#039;&#039;&#039; instead and are therefore in the &#039;&#039;&#039;Patterns&#039;&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
=== The &#039;Patterns&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
This group contains blocks that are applicable to GUI elements supporting a certain &#039;&#039;&#039;pattern&#039;&#039;&#039;. &#039;&#039;&#039;Patterns&#039;&#039;&#039; describe how a GUI element &#039;&#039;&#039;behaves&#039;&#039;&#039; rather than what it &#039;&#039;&#039;is&#039;&#039;&#039;. An element can also support multiple patterns&lt;br /&gt;
at the same time. You can find out which patterns an element supports with the &#039;&#039;&#039;Get Supported Patterns&#039;&#039;&#039; block or by taking a look at Microsoft&#039;s documentation about patterns [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview].&lt;br /&gt;
&lt;br /&gt;
Pattern blocks can therefore be &#039;&#039;&#039;re-used&#039;&#039;&#039; between GUI elements of different types. The &#039;&#039;&#039;Expand&#039;&#039;&#039; block of the &#039;&#039;&#039;ExpandCollapse pattern&#039;&#039;&#039;, for example, can be used to expand Comboboxes, Menus, Submenus, or Trees.&lt;br /&gt;
&lt;br /&gt;
=== The &#039;Properties&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
Blocks in the &#039;&#039;&#039;Patterns&#039;&#039;&#039; and &#039;&#039;&#039;Elements&#039;&#039;&#039; group already allow you to query the value of properties pertaining to that element or pattern. Blocks of the &#039;&#039;&#039;Properties&#039;&#039;&#039; group allow you to query properties all elements share as well as arbitrary properties. If you try to retrieve a property an element does not support, the block will fail.&lt;br /&gt;
&lt;br /&gt;
Please note that the &#039;&#039;&#039;Get Arbitrary Property&#039;&#039;&#039; block can only query for properties that belong to a pattern. You cannot, for example, query &amp;quot;Text&amp;quot; from a textfield as this is not a property, use &amp;quot;Value&amp;quot; of the value pattern instead. Microsoft&#039;s documentation has a list of patterns and the properties they provide [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Automating Keyboard and Mouse ==&lt;br /&gt;
[[Bild:WindowsAutomation_Library_KeyboardMouse.png|frame|The Library&#039;s Blocks for Interacting With Keyboard and Mouse.]]&lt;br /&gt;
&lt;br /&gt;
You can control keyboard and mouse with the blocks in the groups &#039;&#039;&#039;Keyboard&#039;&#039;&#039; and &#039;&#039;&#039;Mouse&#039;&#039;&#039; that can be seen on the right. In contrast to the blocks above which work in context of a GUI element, the keyboard and mouse blocks work on a global level. You therefore do not need to provide a GUI element when using them. &lt;br /&gt;
&lt;br /&gt;
You might want to execute some blocks in context of a GUI elemenet nontheless (e.g. enter a number into a text field instead of just pressing keys while the application is running). You can achieve this by selecting the element with the mouse beforehand as you would do when using the application normally (use the &#039;&#039;&#039;Left/Double/Right Click On Element&#039;&#039;&#039; blocks for this).&lt;br /&gt;
If you do not want to wait for the mouse to move, you can also use the &#039;&#039;&#039;Set Focus&#039;&#039;&#039; block instead.&lt;br /&gt;
&lt;br /&gt;
=== Keyboard ===&lt;br /&gt;
The plugin provides blocks interacting with the keyboard on different abstraction levels. The most versatile block is &#039;&#039;&#039;Type With Control Keys Pressed&#039;&#039;&#039; where you can specify a string of characters to be typed while any number of control keys (e.g. esc, alt, shift, ctrl, ...) are held down. All other blocks are specializations of this block.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Press Control Keys&#039;&#039;&#039; e.g. allows you to enter key commands such as renaming files (ALT+F2), starting the task manager (CTRL+ALT+DEL), or closing a window (ALT+F4). &#039;&#039;&#039;Press Control Key&#039;&#039;&#039; makes it easy to just press a single key (e.g. RETURN to start a new line in an edit box). The &#039;&#039;&#039;Shortcuts&#039;&#039;&#039; group provides an assorted collection of often used key combinations for your convenience.&lt;br /&gt;
&lt;br /&gt;
Use the &#039;&#039;&#039;Type&#039;&#039;&#039; to just type some text or, if you just need some throwaway demo text, use &#039;&#039;&#039;Type Random Phrase&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you need more fine grained control over the keyboard, you can make use of &#039;&#039;&#039;Scan Codes&#039;&#039;&#039;. The keyboard sends a scan codeto the operating system whenever a key is pressed or released. &lt;br /&gt;
Microsoft provides a list of the scan codes it supports [https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa299374(v=vs.60)].&lt;br /&gt;
&#039;&#039;&#039;Press Key By Scan Code&#039;&#039;&#039; sends Windows a signal that a key with a given scan code has been pressed (and is held down). The matching &#039;&#039;&#039;Release Key By Scan Code&#039;&#039;&#039; sends Windows the adverse signal.&lt;br /&gt;
Please note that a key that is pressed, stays pressed until it is explicitly released. If you want to just press and release a key by scan code, use &#039;&#039;&#039;Type Key By Scan Code&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Mouse ===&lt;br /&gt;
The plugin provides blocks manipulating the mouse in three ways: &#039;&#039;&#039;Clicking&#039;&#039;&#039;, &#039;&#039;&#039;Moving&#039;&#039;&#039;, and interacting with its &#039;&#039;&#039;Buttons&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Recording and Taking Screenshots ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Frequently Asked Questions =&lt;br /&gt;
&lt;br /&gt;
== What is the difference between Click/Invoke/Select/Toggle? ==&lt;br /&gt;
&lt;br /&gt;
== My element supports a certain pattern but blocks of that pattern don&#039;t work? ==&lt;br /&gt;
&lt;br /&gt;
== I have designed custom elements, how can I automate them? ==&lt;br /&gt;
&lt;br /&gt;
== I have extended my GUI elements to have custom properties, how can I query them? ==&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11491</id>
		<title>WindowsAutomation Reference 2.0</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11491"/>
		<updated>2018-06-04T07:58:22Z</updated>

		<summary type="html">&lt;p&gt;Lv: /* Keyboard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the documentation for the Windows Automation 2.0 plugin.&lt;br /&gt;
&lt;br /&gt;
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
*Automated GUI testing of WPF, WinForms, and Win32 applications.&lt;br /&gt;
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.&lt;br /&gt;
*Parallel remote test-execution on multiple systems.&lt;br /&gt;
*Performs tests against already built executables. No source code changes / recompilation of the application is required.&lt;br /&gt;
*Access to GUI components using XPath locators.&lt;br /&gt;
*Access objects of the application live at execution time.&lt;br /&gt;
*Full access to keyboard and mouse of the target system.&lt;br /&gt;
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...&lt;br /&gt;
&lt;br /&gt;
=Installation and Connection=&lt;br /&gt;
The WindowsAutomation testing plugin uses the expecoo &amp;quot;.NET-Bridge&amp;quot; which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
On the machine running the system under test:&lt;br /&gt;
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.&lt;br /&gt;
* One of the following operation systems:&lt;br /&gt;
::- Windows 7 SP1&lt;br /&gt;
::- Windows 8&lt;br /&gt;
::- Windows 8.1&lt;br /&gt;
::- Windows 10&lt;br /&gt;
&lt;br /&gt;
::- Windows Server 2008 R2 SP1&lt;br /&gt;
::- Windows Server 2012&lt;br /&gt;
::- Windows Server 2012 R2&lt;br /&gt;
::- Windows Server 2016&lt;br /&gt;
::- Windows Server, version 1709&lt;br /&gt;
&lt;br /&gt;
==Plugin Components==&lt;br /&gt;
The plugin consists of the following parts:&lt;br /&gt;
* The GUI Browser, used to interactively explore your application.&lt;br /&gt;
* The Windows Automation Library, which provides blocks that you can use in your test cases.&lt;br /&gt;
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.&lt;br /&gt;
&lt;br /&gt;
==Installing and Configuring the Plugin in Expecco==&lt;br /&gt;
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the &amp;quot;plugin&amp;quot; subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Preparing a local system for test execution==&lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Everything should work out of the box.&lt;br /&gt;
&lt;br /&gt;
TODO: Is that still true with the gui browser?&lt;br /&gt;
TODO: Pictures for the connection process&lt;br /&gt;
&lt;br /&gt;
==Preparing a remote system for test exeuction==&lt;br /&gt;
The remote system will have to run the &amp;quot;.Net-Bridge server&amp;quot; which in turn connects to expecco. &lt;br /&gt;
You just need to copy &amp;quot;DotNetBridgeServer.exe&amp;quot; to the computer your system under test is running on. No further installation is needed.&lt;br /&gt;
&lt;br /&gt;
To start the bridge, navigate to the executable in a shell and start it with the following arguments:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Arguments !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| -s || Yes || Tells the executable to run in server mode (as opposed to client mode).&lt;br /&gt;
|-&lt;br /&gt;
| -k || Yes || Tells the client to keep the connection open after aconnection has been terminated saving you the hassle to restart it every time a test finishes.&lt;br /&gt;
|-&lt;br /&gt;
| -a &amp;lt;ip/hostname&amp;gt;|| Yes || The IP-Address of the PC your application is running on.&lt;br /&gt;
|-&lt;br /&gt;
| -p &amp;lt;int&amp;gt; || No || The port the server should listen on (default is 34318).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
TODO: What settings does the plugin have?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GUI Browser=&lt;br /&gt;
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description also see [[Expecco GUI Tests Extension Reference|Gui Browser]].&lt;br /&gt;
&lt;br /&gt;
=Library=&lt;br /&gt;
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.&lt;br /&gt;
&lt;br /&gt;
== Connecting to an Application ==&lt;br /&gt;
To automate an application, you first have to connect to it. You can do this with the&lt;br /&gt;
blocks from the &#039;&#039;&#039;Connecting&#039;&#039;&#039; group.&lt;br /&gt;
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library&#039;s Connection Blocks.]]&lt;br /&gt;
&lt;br /&gt;
You can connect to an application by its &#039;&#039;&#039;executable name&#039;&#039;&#039;, or by its &#039;&#039;&#039;process id&#039;&#039;&#039;. &lt;br /&gt;
If you use the executable name, expecco will attach to the main process of the specified executable. Be careful as this is not necessarily the process &lt;br /&gt;
drawing the GUI! Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.&lt;br /&gt;
All connection blocks also require you to specify a &#039;&#039;&#039;name&#039;&#039;&#039; by which the connection should be known in future.&lt;br /&gt;
This is needed for when you automate multiple applications at the same time and need to change&lt;br /&gt;
&#039;&#039;&#039;connection contexts&#039;&#039;&#039; during test execution.&lt;br /&gt;
Please note that the application to connect to has to be started before the corresponding connection block is executed.&lt;br /&gt;
You can change in context of which connection a block is executed with the &#039;&#039;&#039;Set Active Connection&#039;&#039;&#039; block.&lt;br /&gt;
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Local Connection === &lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Just use the &#039;&#039;&#039;Create Local Connection&#039;&#039;&#039; with the mentioned above parameters.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Remote Connection ===&lt;br /&gt;
Make sure that the DotNet Bridge server is started as explained in [[#Preparing a remote system for test exeuction]]&lt;br /&gt;
When the bridge is running, you can connect to it with the &#039;&#039;&#039;Create Remote Connection&#039;&#039;&#039; block using the hostname and IP-Address you specified when you started the bridge.&lt;br /&gt;
&lt;br /&gt;
=== Closing a Connection ===&lt;br /&gt;
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.&lt;br /&gt;
One simple way to do this is to setup your connections in the &#039;&#039;&#039;Before Execution&#039;&#039;&#039; part of the test suite&lt;br /&gt;
and put the &#039;&#039;&#039;Close All Connections&#039;&#039;&#039; block in the &#039;&#039;&#039;After exeuction&#039;&#039;&#039; part.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Accessing GUI Elements ==&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library&#039;s GUI Element Access Blocks.]]&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksExamples.PNG|frame|A Few Examples on How to Access Elements in Notepad.]]&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksModes.PNG|frame|Different Ways to Reference a GUI Element.]]&lt;br /&gt;
All Windows applications are built as a &#039;&#039;&#039; tree&#039;&#039;&#039;  of &#039;&#039;&#039; GUI elements&#039;&#039;&#039; .&lt;br /&gt;
Some elements act as container of other element - their children. Tables, for example, are containers&lt;br /&gt;
for their cell elements which themselves might contain text labels.&lt;br /&gt;
At the root of the tree are one or more &#039;&#039;&#039;windows&#039;&#039;&#039; . When you connect to an application, you get access to&lt;br /&gt;
all windows at the tree&#039;s root.&lt;br /&gt;
To manipulate any of the system under test&#039;s GUI element, you first have to gain access to it.&lt;br /&gt;
The group &#039;&#039;&#039;GUI Element Access&#039;&#039;&#039;  provides blocks that help you to gain access to the elements. There are 12 blocks in total, divided between &#039;&#039;&#039; Access By XPath&#039;&#039;&#039; , &#039;&#039;&#039;Access By Property&#039;&#039;&#039;,&lt;br /&gt;
and &#039;&#039;&#039;Existence Test&#039;&#039;&#039;. For each category, blocks with the same interface exist. The only difference is the method of retrival.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Element : returns a &#039;&#039;&#039;single&#039;&#039;&#039; GUI Element matching the search condition. If multiple match the condition, an &#039;&#039;&#039;arbitrary&#039;&#039;&#039; element matching the condition is returned.&lt;br /&gt;
:If you want to make sure that there is only one element matching, set &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039;  to true. You can also enforce this globally by setting the environment variable &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039; in your environment. &lt;br /&gt;
:If ensureExclusive is set and more than one element is found, the block will fail and notify you of the ambiguity. This is disabled by default as checking for uniqueness is a very costly operation.&lt;br /&gt;
:You can also specify a &#039;&#039;&#039;timeout&#039;&#039;&#039; after which the search is aborted. This is useful if you know an element should be there soon but might currently be loading.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Elements: returns &#039;&#039;&#039;all&#039;&#039;&#039; GUI Element matching the search condition. If no element is found, it returns an empty list &amp;lt;b&amp;gt; Timeout &amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;cacheXPath&amp;lt;/b&amp;gt; are also applicable.&lt;br /&gt;
&lt;br /&gt;
;Exists: Works exactly the same as &#039;&#039;&#039;Get GUI Element&#039;&#039;&#039; but does not fail if no element can be found. Additionally provides an output pin specifying if an element has been found.&lt;br /&gt;
&lt;br /&gt;
Both of these blocks are also available in the &#039;&#039;&#039;Relative To Anchor&#039;&#039;&#039; variety. Those blocks also take a GUI Element as &#039;&#039;&#039;anchor&#039;&#039;&#039; in relation to which they search. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Using XPaths ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;XPath&#039;&#039;&#039; is the query language this plugin uses for selecting GUI elements in the application&#039;s element tree.&lt;br /&gt;
You can find the XPath of an element with the [[Expecco GUI Tests Extension Reference|Gui Browser]] or with third-party applications like Inspect.exe [https://msdn.microsoft.com/en-us/library/dd318521(v=vs.85).aspx] or FlaUInspect [https://github.com/FlauTech/FlaUInspect].&lt;br /&gt;
An &#039;&#039;&#039;XPath&#039;&#039;&#039; for the scroll button on the &lt;br /&gt;
vertical scrollbar in the german Windows Notepad application looks like this:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;]/Document[@Name=&#039;Text-Editor&#039;]/ScrollBar[@Name=&#039;Vertikale Bildlaufleiste&#039;]/Button[@Name=&#039;Bildlauf nach unten&#039;] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each level in the GUI tree, a new &amp;lt;b&amp;gt;Location Step&amp;lt;/b&amp;gt; containing the child elements &amp;lt;b&amp;gt;Control Type&amp;lt;/b&amp;gt; has to be added.&lt;br /&gt;
You do not have to use any predicates, the following XPath is valid as well:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window/Document/ScrollBar/Button &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but might lead to issues as there might be multiple GUI Elements matching this path.&lt;br /&gt;
You can select by three predicates that can be mixed and matched in the same query:&lt;br /&gt;
&lt;br /&gt;
; Name: the name the application developer has given an element. Be careful as this name might change during programm execution (See for example Notepad&#039;s window name which always begins with the name of the currently opened file.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
; AutomationId: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced.&lt;br /&gt;
: Many developersleave the ID empty or reuse it, making it useless. You should nontheless use this ID wherever applicable as it is static&lt;br /&gt;
: and meant for this exact purpose.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;List Index: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[last()] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please Note&#039;&#039;&#039;: You can &#039;&#039;&#039;only&#039;&#039;&#039; use the three predicates above in your XPaths. Other predicates &#039;&#039;&#039;DO NOT&#039;&#039;&#039; work! If you want to search&lt;br /&gt;
an element by another property (e.g. its help text), use the &#039;&#039;&#039;By Property&#039;&#039;&#039; variant of the block instead. If the property is not unique,&lt;br /&gt;
you can select a unique ancestor of the target by property or XPath relative to which the property is unique.&lt;br /&gt;
You can then use that ancestor as anchor in the &#039;&#039;&#039;Get GUI Element By Property (Relative to Anchor)&#039;&#039;&#039; block.&lt;br /&gt;
&lt;br /&gt;
=== Using Wildcards in XPaths ===&lt;br /&gt;
&lt;br /&gt;
XPath also supports &#039;&#039;&#039;wildcards&#039;&#039;&#039;. You can:&lt;br /&gt;
* replace &#039;&#039;&#039;one tree level&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard: &lt;br /&gt;
&amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;]/*/Button[1]&amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/*/*/*/Button[1] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace a &#039;&#039;&#039;control type&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;/Window/*[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace &#039;&#039;&#039;an arbitrary amount of tree levels&#039;&#039;&#039; with a &amp;quot;//&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;//Button &amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/Window//Button[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Especially the last option is useful as it makes your tests &amp;lt;b&amp;gt;more readable&amp;lt;/b&amp;gt; as the reader can easily focus on the relevant parts of the xpath.&lt;br /&gt;
But be careful. Using wildcards comes at a steep &amp;lt;b&amp;gt;performance cost&amp;lt;/b&amp;gt;. If your tests run unacceptably slow, first try to &#039;&#039;&#039;remove wildcards where they are not needed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Using Properties===&lt;br /&gt;
&lt;br /&gt;
You can also search for elements by property by specifying a value an element&#039;s property with the given name must have. For a list of properties a GUI element might have, take a look at Microsoft&#039;s documentation [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]. It specifies the supported properties for each pattern an element can support.&lt;br /&gt;
&lt;br /&gt;
=== XPath Resolution in Action Blocks ===&lt;br /&gt;
&lt;br /&gt;
Getting a reference to the GUI Element everytime you need to manipulate it in any way can make for very unclean looking test suites as two blocks are needed to perform any action - one for getting a reference to the element and another one for perform the action. The library therefore also allows you to directly feed an xpath into every block that would take a reference to a GUI Element.&lt;br /&gt;
&lt;br /&gt;
The image on the right shows this mode in action. Variants 1 and 2 are functionally equivalent.&lt;br /&gt;
While Variant 2 is more concise, Variant 1 is the right choice in most cases. While it has an additional block, you have control over the other input parameters. &lt;br /&gt;
You also can recycle the GUI element reference as seen in 3). This is invaluable as the XPath only has to be resolved once. This speeds up test execution by a lot as XPath resolution is very expensive operation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rule of thumb&#039;&#039;&#039;: Always use Variant 1 except if you need the reference to the GUI element only once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Interacting with GUI Elements ==&lt;br /&gt;
Once you retrieved a GUI element, you can interact with it by making use of the library&#039;s blocks located in the groups &#039;&#039;&#039;Elements&#039;&#039;&#039;, &#039;&#039;&#039;Patterns&#039;&#039;&#039;, and &#039;&#039;&#039;Properties&#039;&#039;&#039;. &lt;br /&gt;
Blocks in those categories take a GUI Element (and sometimes additional data) as input and manipulate it or query for its properties in some way.&lt;br /&gt;
&lt;br /&gt;
[[Bild:WindowsAutomation_Library_ElementsPatternsProperties.png|frame|The Library&#039;s Blocks for Interacting With Elements.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The &#039;Elements&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
This group contains blocks that are applicable to blocks that only work on &#039;&#039;&#039;GUI elements of a specific type&#039;&#039;&#039;. For a block&#039;s detailed description with examples ,&lt;br /&gt;
take a look at the block&#039;s documentation in expecco.&lt;br /&gt;
&lt;br /&gt;
Even though not only Checkboxes can be &#039;checked&#039;, the &#039;&#039;&#039;Check&#039;&#039;&#039; block in the &#039;&#039;&#039;Checkbox group&#039;&#039;&#039; only works for checkboxes and not e.g. for radio buttons. &lt;br /&gt;
Because of this limitation there are not that many blocks targeting specific elements. Most blocks target a specific &#039;&#039;&#039;pattern&#039;&#039;&#039; instead and are therefore in the &#039;&#039;&#039;Patterns&#039;&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
=== The &#039;Patterns&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
This group contains blocks that are applicable to GUI elements supporting a certain &#039;&#039;&#039;pattern&#039;&#039;&#039;. &#039;&#039;&#039;Patterns&#039;&#039;&#039; describe how a GUI element &#039;&#039;&#039;behaves&#039;&#039;&#039; rather than what it &#039;&#039;&#039;is&#039;&#039;&#039;. An element can also support multiple patterns&lt;br /&gt;
at the same time. You can find out which patterns an element supports with the &#039;&#039;&#039;Get Supported Patterns&#039;&#039;&#039; block or by taking a look at Microsoft&#039;s documentation about patterns [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview].&lt;br /&gt;
&lt;br /&gt;
Pattern blocks can therefore be &#039;&#039;&#039;re-used&#039;&#039;&#039; between GUI elements of different types. The &#039;&#039;&#039;Expand&#039;&#039;&#039; block of the &#039;&#039;&#039;ExpandCollapse pattern&#039;&#039;&#039;, for example, can be used to expand Comboboxes, Menus, Submenus, or Trees.&lt;br /&gt;
&lt;br /&gt;
=== The &#039;Properties&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
Blocks in the &#039;&#039;&#039;Patterns&#039;&#039;&#039; and &#039;&#039;&#039;Elements&#039;&#039;&#039; group already allow you to query the value of properties pertaining to that element or pattern. Blocks of the &#039;&#039;&#039;Properties&#039;&#039;&#039; group allow you to query properties all elements share as well as arbitrary properties. If you try to retrieve a property an element does not support, the block will fail.&lt;br /&gt;
&lt;br /&gt;
Please note that the &#039;&#039;&#039;Get Arbitrary Property&#039;&#039;&#039; block can only query for properties that belong to a pattern. You cannot, for example, query &amp;quot;Text&amp;quot; from a textfield as this is not a property, use &amp;quot;Value&amp;quot; of the value pattern instead. Microsoft&#039;s documentation has a list of patterns and the properties they provide [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Automating Keyboard and Mouse ==&lt;br /&gt;
[[Bild:WindowsAutomation_Library_KeyboardMouse.png|frame|The Library&#039;s Blocks for Interacting With Keyboard and Mouse.]]&lt;br /&gt;
&lt;br /&gt;
You can control keyboard and mouse with the blocks in the groups &#039;&#039;&#039;Keyboard&#039;&#039;&#039; and &#039;&#039;&#039;Mouse&#039;&#039;&#039; that can be seen on the right. In contrast to the blocks above which work in context of a GUI element, the keyboard and mouse blocks work on a global level. You therefore do not need to provide a GUI element when using them. &lt;br /&gt;
&lt;br /&gt;
You might want to execute some blocks in context of a GUI elemenet nontheless (e.g. enter a number into a text field instead of just pressing keys while the application is running). You can achieve this by selecting the element with the mouse beforehand as you would do when using the application normally (use the &#039;&#039;&#039;Left/Double/Right Click On Element&#039;&#039;&#039; blocks for this).&lt;br /&gt;
If you do not want to wait for the mouse to move, you can also use the &#039;&#039;&#039;Set Focus&#039;&#039;&#039; block instead.&lt;br /&gt;
&lt;br /&gt;
=== Keyboard ===&lt;br /&gt;
The plugin provides blocks interacting with the keyboard on different abstraction levels. The most versatile block is &#039;&#039;&#039;Type With Control Keys Pressed&#039;&#039;&#039; where you can specify a string of characters to be typed while any number of control keys (e.g. esc, alt, shift, ctrl, ...) are held down. All other blocks are specializations of this block.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Press Control Keys&#039;&#039;&#039; e.g. allows you to enter key commands such as renaming files (ALT+F2), starting the task manager (CTRL+ALT+DEL), or closing a window (ALT+F4). &#039;&#039;&#039;Press Control Key&#039;&#039;&#039; makes it easy to just press a single key (e.g. RETURN to start a new line in an edit box). The &#039;&#039;&#039;Shortcuts&#039;&#039;&#039; group provides an assorted collection of often used key combinations for your convenience.&lt;br /&gt;
&lt;br /&gt;
Use the &#039;&#039;&#039;Type&#039;&#039;&#039; to just type some text or, if you just need some throwaway demo text, use &#039;&#039;&#039;Type Random Phrase&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you need more fine grained control over the keyboard, you can make use of &#039;&#039;&#039;Scan Codes&#039;&#039;&#039;. The keyboard sends a scan codeto the operating system whenever a key is pressed or released. &lt;br /&gt;
Microsoft provides a list of the scan codes it supports [https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa299374(v=vs.60)].&lt;br /&gt;
&#039;&#039;&#039;Press Key By Scan Code&#039;&#039;&#039; sends Windows a signal that a key with a given scan code has been pressed (and is held down). The matching &#039;&#039;&#039;Release Key By Scan Code&#039;&#039;&#039; sends Windows the adverse signal.&lt;br /&gt;
Please note that a key that is pressed, stays pressed until it is explicitly released. If you want to just press and release a key by scan code, use &#039;&#039;&#039;Type Key By Scan Code&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Mouse ===&lt;br /&gt;
The plugin provides blocks manipulating the mouse in three ways: &#039;&#039;&#039;Clicking&#039;&#039;&#039;, &#039;&#039;&#039;Moving&#039;&#039;&#039;, and interacting with its &#039;&#039;&#039;Buttons&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Recording and Taking Screenshots ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Frequently Asked Questions =&lt;br /&gt;
&lt;br /&gt;
== What is the difference between Click/Invoke/Select/Toggle? ==&lt;br /&gt;
&lt;br /&gt;
== My element supports a certain pattern but blocks of that pattern don&#039;t work? ==&lt;br /&gt;
&lt;br /&gt;
== I have designed custom elements, how can I automate them? ==&lt;br /&gt;
&lt;br /&gt;
== I have extended my GUI elements to have custom properties, how can I query them? ==&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11428</id>
		<title>WindowsAutomation Reference 2.0</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11428"/>
		<updated>2018-05-30T14:09:57Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the documentation for the Windows Automation 2.0 plugin.&lt;br /&gt;
&lt;br /&gt;
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
*Automated GUI testing of WPF, WinForms, and Win32 applications.&lt;br /&gt;
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.&lt;br /&gt;
*Parallel remote test-execution on multiple systems.&lt;br /&gt;
*Performs tests against already built executables. No source code changes / recompilation of the application is required.&lt;br /&gt;
*Access to GUI components using XPath locators.&lt;br /&gt;
*Access objects of the application live at execution time.&lt;br /&gt;
*Full access to keyboard and mouse of the target system.&lt;br /&gt;
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...&lt;br /&gt;
&lt;br /&gt;
=Installation and Connection=&lt;br /&gt;
The WindowsAutomation testing plugin uses the expecoo &amp;quot;.NET-Bridge&amp;quot; which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
On the machine running the system under test:&lt;br /&gt;
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.&lt;br /&gt;
* One of the following operation systems:&lt;br /&gt;
::- Windows 7 SP1&lt;br /&gt;
::- Windows 8&lt;br /&gt;
::- Windows 8.1&lt;br /&gt;
::- Windows 10&lt;br /&gt;
&lt;br /&gt;
::- Windows Server 2008 R2 SP1&lt;br /&gt;
::- Windows Server 2012&lt;br /&gt;
::- Windows Server 2012 R2&lt;br /&gt;
::- Windows Server 2016&lt;br /&gt;
::- Windows Server, version 1709&lt;br /&gt;
&lt;br /&gt;
==Plugin Components==&lt;br /&gt;
The plugin consists of the following parts:&lt;br /&gt;
* The GUI Browser, used to interactively explore your application.&lt;br /&gt;
* The Windows Automation Library, which provides blocks that you can use in your test cases.&lt;br /&gt;
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.&lt;br /&gt;
&lt;br /&gt;
==Installing and Configuring the Plugin in Expecco==&lt;br /&gt;
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the &amp;quot;plugin&amp;quot; subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Preparing a local system for test execution==&lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Everything should work out of the box.&lt;br /&gt;
&lt;br /&gt;
TODO: Is that still true with the gui browser?&lt;br /&gt;
TODO: Pictures for the connection process&lt;br /&gt;
&lt;br /&gt;
==Preparing a remote system for test exeuction==&lt;br /&gt;
The remote system will have to run the &amp;quot;.Net-Bridge server&amp;quot; which in turn connects to expecco. &lt;br /&gt;
You just need to copy &amp;quot;DotNetBridgeServer.exe&amp;quot; to the computer your system under test is running on. No further installation is needed.&lt;br /&gt;
&lt;br /&gt;
To start the bridge, navigate to the executable in a shell and start it with the following arguments:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Arguments !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| -s || Yes || Tells the executable to run in server mode (as opposed to client mode).&lt;br /&gt;
|-&lt;br /&gt;
| -k || Yes || Tells the client to keep the connection open after aconnection has been terminated saving you the hassle to restart it every time a test finishes.&lt;br /&gt;
|-&lt;br /&gt;
| -a &amp;lt;ip/hostname&amp;gt;|| Yes || The IP-Address of the PC your application is running on.&lt;br /&gt;
|-&lt;br /&gt;
| -p &amp;lt;int&amp;gt; || No || The port the server should listen on (default is 34318).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
TODO: What settings does the plugin have?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GUI Browser=&lt;br /&gt;
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description also see [[Expecco GUI Tests Extension Reference|Gui Browser]].&lt;br /&gt;
&lt;br /&gt;
=Library=&lt;br /&gt;
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.&lt;br /&gt;
&lt;br /&gt;
== Connecting to an Application ==&lt;br /&gt;
To automate an application, you first have to connect to it. You can do this with the&lt;br /&gt;
blocks from the &#039;&#039;&#039;Connecting&#039;&#039;&#039; group.&lt;br /&gt;
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library&#039;s Connection Blocks.]]&lt;br /&gt;
&lt;br /&gt;
You can connect to an application by its &#039;&#039;&#039;executable name&#039;&#039;&#039;, or by its &#039;&#039;&#039;process id&#039;&#039;&#039;. &lt;br /&gt;
If you use the executable name, expecco will attach to the main process of the specified executable. Be careful as this is not necessarily the process &lt;br /&gt;
drawing the GUI! Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.&lt;br /&gt;
All connection blocks also require you to specify a &#039;&#039;&#039;name&#039;&#039;&#039; by which the connection should be known in future.&lt;br /&gt;
This is needed for when you automate multiple applications at the same time and need to change&lt;br /&gt;
&#039;&#039;&#039;connection contexts&#039;&#039;&#039; during test execution.&lt;br /&gt;
Please note that the application to connect to has to be started before the corresponding connection block is executed.&lt;br /&gt;
You can change in context of which connection a block is executed with the &#039;&#039;&#039;Set Active Connection&#039;&#039;&#039; block.&lt;br /&gt;
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Local Connection === &lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Just use the &#039;&#039;&#039;Create Local Connection&#039;&#039;&#039; with the mentioned above parameters.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Remote Connection ===&lt;br /&gt;
Make sure that the DotNet Bridge server is started as explained in [[#Preparing a remote system for test exeuction]]&lt;br /&gt;
When the bridge is running, you can connect to it with the &#039;&#039;&#039;Create Remote Connection&#039;&#039;&#039; block using the hostname and IP-Address you specified when you started the bridge.&lt;br /&gt;
&lt;br /&gt;
=== Closing a Connection ===&lt;br /&gt;
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.&lt;br /&gt;
One simple way to do this is to setup your connections in the &#039;&#039;&#039;Before Execution&#039;&#039;&#039; part of the test suite&lt;br /&gt;
and put the &#039;&#039;&#039;Close All Connections&#039;&#039;&#039; block in the &#039;&#039;&#039;After exeuction&#039;&#039;&#039; part.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Accessing GUI Elements ==&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library&#039;s GUI Element Access Blocks.]]&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksExamples.PNG|frame|A Few Examples on How to Access Elements in Notepad.]]&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksModes.PNG|frame|Different Ways to Reference a GUI Element.]]&lt;br /&gt;
All Windows applications are built as a &#039;&#039;&#039; tree&#039;&#039;&#039;  of &#039;&#039;&#039; GUI elements&#039;&#039;&#039; .&lt;br /&gt;
Some elements act as container of other element - their children. Tables, for example, are containers&lt;br /&gt;
for their cell elements which themselves might contain text labels.&lt;br /&gt;
At the root of the tree are one or more &#039;&#039;&#039;windows&#039;&#039;&#039; . When you connect to an application, you get access to&lt;br /&gt;
all windows at the tree&#039;s root.&lt;br /&gt;
To manipulate any of the system under test&#039;s GUI element, you first have to gain access to it.&lt;br /&gt;
The group &#039;&#039;&#039;GUI Element Access&#039;&#039;&#039;  provides blocks that help you to gain access to the elements. There are 12 blocks in total, divided between &#039;&#039;&#039; Access By XPath&#039;&#039;&#039; , &#039;&#039;&#039;Access By Property&#039;&#039;&#039;,&lt;br /&gt;
and &#039;&#039;&#039;Existence Test&#039;&#039;&#039;. For each category, blocks with the same interface exist. The only difference is the method of retrival.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Element : returns a &#039;&#039;&#039;single&#039;&#039;&#039; GUI Element matching the search condition. If multiple match the condition, an &#039;&#039;&#039;arbitrary&#039;&#039;&#039; element matching the condition is returned.&lt;br /&gt;
:If you want to make sure that there is only one element matching, set &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039;  to true. You can also enforce this globally by setting the environment variable &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039; in your environment. &lt;br /&gt;
:If ensureExclusive is set and more than one element is found, the block will fail and notify you of the ambiguity. This is disabled by default as checking for uniqueness is a very costly operation.&lt;br /&gt;
:You can also specify a &#039;&#039;&#039;timeout&#039;&#039;&#039; after which the search is aborted. This is useful if you know an element should be there soon but might currently be loading.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Elements: returns &#039;&#039;&#039;all&#039;&#039;&#039; GUI Element matching the search condition. If no element is found, it returns an empty list &amp;lt;b&amp;gt; Timeout &amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;cacheXPath&amp;lt;/b&amp;gt; are also applicable.&lt;br /&gt;
&lt;br /&gt;
;Exists: Works exactly the same as &#039;&#039;&#039;Get GUI Element&#039;&#039;&#039; but does not fail if no element can be found. Additionally provides an output pin specifying if an element has been found.&lt;br /&gt;
&lt;br /&gt;
Both of these blocks are also available in the &#039;&#039;&#039;Relative To Anchor&#039;&#039;&#039; variety. Those blocks also take a GUI Element as &#039;&#039;&#039;anchor&#039;&#039;&#039; in relation to which they search. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Using XPaths ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;XPath&#039;&#039;&#039; is the query language this plugin uses for selecting GUI elements in the application&#039;s element tree.&lt;br /&gt;
You can find the XPath of an element with the [[Expecco GUI Tests Extension Reference|Gui Browser]] or with third-party applications like Inspect.exe [https://msdn.microsoft.com/en-us/library/dd318521(v=vs.85).aspx] or FlaUInspect [https://github.com/FlauTech/FlaUInspect].&lt;br /&gt;
An &#039;&#039;&#039;XPath&#039;&#039;&#039; for the scroll button on the &lt;br /&gt;
vertical scrollbar in the german Windows Notepad application looks like this:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;]/Document[@Name=&#039;Text-Editor&#039;]/ScrollBar[@Name=&#039;Vertikale Bildlaufleiste&#039;]/Button[@Name=&#039;Bildlauf nach unten&#039;] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each level in the GUI tree, a new &amp;lt;b&amp;gt;Location Step&amp;lt;/b&amp;gt; containing the child elements &amp;lt;b&amp;gt;Control Type&amp;lt;/b&amp;gt; has to be added.&lt;br /&gt;
You do not have to use any predicates, the following XPath is valid as well:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window/Document/ScrollBar/Button &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but might lead to issues as there might be multiple GUI Elements matching this path.&lt;br /&gt;
You can select by three predicates that can be mixed and matched in the same query:&lt;br /&gt;
&lt;br /&gt;
; Name: the name the application developer has given an element. Be careful as this name might change during programm execution (See for example Notepad&#039;s window name which always begins with the name of the currently opened file.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
; AutomationId: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced.&lt;br /&gt;
: Many developersleave the ID empty or reuse it, making it useless. You should nontheless use this ID wherever applicable as it is static&lt;br /&gt;
: and meant for this exact purpose.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;List Index: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[last()] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please Note&#039;&#039;&#039;: You can &#039;&#039;&#039;only&#039;&#039;&#039; use the three predicates above in your XPaths. Other predicates &#039;&#039;&#039;DO NOT&#039;&#039;&#039; work! If you want to search&lt;br /&gt;
an element by another property (e.g. its help text), use the &#039;&#039;&#039;By Property&#039;&#039;&#039; variant of the block instead. If the property is not unique,&lt;br /&gt;
you can select a unique ancestor of the target by property or XPath relative to which the property is unique.&lt;br /&gt;
You can then use that ancestor as anchor in the &#039;&#039;&#039;Get GUI Element By Property (Relative to Anchor)&#039;&#039;&#039; block.&lt;br /&gt;
&lt;br /&gt;
=== Using Wildcards in XPaths ===&lt;br /&gt;
&lt;br /&gt;
XPath also supports &#039;&#039;&#039;wildcards&#039;&#039;&#039;. You can:&lt;br /&gt;
* replace &#039;&#039;&#039;one tree level&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard: &lt;br /&gt;
&amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;]/*/Button[1]&amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/*/*/*/Button[1] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace a &#039;&#039;&#039;control type&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;/Window/*[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace &#039;&#039;&#039;an arbitrary amount of tree levels&#039;&#039;&#039; with a &amp;quot;//&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;//Button &amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/Window//Button[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Especially the last option is useful as it makes your tests &amp;lt;b&amp;gt;more readable&amp;lt;/b&amp;gt; as the reader can easily focus on the relevant parts of the xpath.&lt;br /&gt;
But be careful. Using wildcards comes at a steep &amp;lt;b&amp;gt;performance cost&amp;lt;/b&amp;gt;. If your tests run unacceptably slow, first try to &#039;&#039;&#039;remove wildcards where they are not needed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Using Properties===&lt;br /&gt;
&lt;br /&gt;
You can also search for elements by property by specifying a value an element&#039;s property with the given name must have. For a list of properties a GUI element might have, take a look at Microsoft&#039;s documentation [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]. It specifies the supported properties for each pattern an element can support.&lt;br /&gt;
&lt;br /&gt;
=== XPath Resolution in Action Blocks ===&lt;br /&gt;
&lt;br /&gt;
Getting a reference to the GUI Element everytime you need to manipulate it in any way can make for very unclean looking test suites as two blocks are needed to perform any action - one for getting a reference to the element and another one for perform the action. The library therefore also allows you to directly feed an xpath into every block that would take a reference to a GUI Element.&lt;br /&gt;
&lt;br /&gt;
The image on the right shows this mode in action. Variants 1 and 2 are functionally equivalent.&lt;br /&gt;
While Variant 2 is more concise, Variant 1 is the right choice in most cases. While it has an additional block, you have control over the other input parameters. &lt;br /&gt;
You also can recycle the GUI element reference as seen in 3). This is invaluable as the XPath only has to be resolved once. This speeds up test execution by a lot as XPath resolution is very expensive operation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rule of thumb&#039;&#039;&#039;: Always use Variant 1 except if you need the reference to the GUI element only once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Interacting with GUI Elements ==&lt;br /&gt;
Once you retrieved a GUI element, you can interact with it by making use of the library&#039;s blocks located in the groups &#039;&#039;&#039;Elements&#039;&#039;&#039;, &#039;&#039;&#039;Patterns&#039;&#039;&#039;, and &#039;&#039;&#039;Properties&#039;&#039;&#039;. &lt;br /&gt;
Blocks in those categories take a GUI Element (and sometimes additional data) as input and manipulate it or query for its properties in some way.&lt;br /&gt;
&lt;br /&gt;
[[Bild:WindowsAutomation_Library_ElementsPatternsProperties.png|frame|The Library&#039;s Blocks for Interacting With Elements.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The &#039;Elements&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
This group contains blocks that are applicable to blocks that only work on &#039;&#039;&#039;GUI elements of a specific type&#039;&#039;&#039;. For a block&#039;s detailed description with examples ,&lt;br /&gt;
take a look at the block&#039;s documentation in expecco.&lt;br /&gt;
&lt;br /&gt;
Even though not only Checkboxes can be &#039;checked&#039;, the &#039;&#039;&#039;Check&#039;&#039;&#039; block in the &#039;&#039;&#039;Checkbox group&#039;&#039;&#039; only works for checkboxes and not e.g. for radio buttons. &lt;br /&gt;
Because of this limitation there are not that many blocks targeting specific elements. Most blocks target a specific &#039;&#039;&#039;pattern&#039;&#039;&#039; instead and are therefore in the &#039;&#039;&#039;Patterns&#039;&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
=== The &#039;Patterns&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
This group contains blocks that are applicable to GUI elements supporting a certain &#039;&#039;&#039;pattern&#039;&#039;&#039;. &#039;&#039;&#039;Patterns&#039;&#039;&#039; describe how a GUI element &#039;&#039;&#039;behaves&#039;&#039;&#039; rather than what it &#039;&#039;&#039;is&#039;&#039;&#039;. An element can also support multiple patterns&lt;br /&gt;
at the same time. You can find out which patterns an element supports with the &#039;&#039;&#039;Get Supported Patterns&#039;&#039;&#039; block or by taking a look at Microsoft&#039;s documentation about patterns [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview].&lt;br /&gt;
&lt;br /&gt;
Pattern blocks can therefore be &#039;&#039;&#039;re-used&#039;&#039;&#039; between GUI elements of different types. The &#039;&#039;&#039;Expand&#039;&#039;&#039; block of the &#039;&#039;&#039;ExpandCollapse pattern&#039;&#039;&#039;, for example, can be used to expand Comboboxes, Menus, Submenus, or Trees.&lt;br /&gt;
&lt;br /&gt;
=== The &#039;Properties&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
Blocks in the &#039;&#039;&#039;Patterns&#039;&#039;&#039; and &#039;&#039;&#039;Elements&#039;&#039;&#039; group already allow you to query the value of properties pertaining to that element or pattern. Blocks of the &#039;&#039;&#039;Properties&#039;&#039;&#039; group allow you to query properties all elements share as well as arbitrary properties. If you try to retrieve a property an element does not support, the block will fail.&lt;br /&gt;
&lt;br /&gt;
Please note that the &#039;&#039;&#039;Get Arbitrary Property&#039;&#039;&#039; block can only query for properties that belong to a pattern. You cannot, for example, query &amp;quot;Text&amp;quot; from a textfield as this is not a property, use &amp;quot;Value&amp;quot; of the value pattern instead. Microsoft&#039;s documentation has a list of patterns and the properties they provide [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Automating Keyboard and Mouse ==&lt;br /&gt;
[[Bild:WindowsAutomation_Library_KeyboardMouse.png|frame|The Library&#039;s Blocks for Interacting With Keyboard and Mouse.]]&lt;br /&gt;
&lt;br /&gt;
You can control keyboard and mouse with the blocks in the groups &#039;&#039;&#039;Keyboard&#039;&#039;&#039; and &#039;&#039;&#039;Mouse&#039;&#039;&#039; that can be seen on the right. In contrast to the blocks above which work in context of a GUI element, the keyboard and mouse blocks work on a global level. You therefore do not need to provide a GUI element when using them. &lt;br /&gt;
&lt;br /&gt;
You might want to execute some blocks in context of a GUI elemenet nontheless (e.g. enter a number into a text field instead of just pressing keys while the application is running). You can achieve this by selecting the element with the mouse beforehand as you would do when using the application normally (use the &#039;&#039;&#039;Left/Double/Right Click On Element&#039;&#039;&#039; blocks for this).&lt;br /&gt;
If you do not want to wait for the mouse to move, you can also use the &#039;&#039;&#039;Set Focus&#039;&#039;&#039; block instead.&lt;br /&gt;
&lt;br /&gt;
=== Keyboard ===&lt;br /&gt;
The plugin provides blocks interacting with the keyboard on different abstraction levels. The most versatile block is &#039;&#039;&#039;Type With Control Keys Pressed&#039;&#039;&#039; where you can specify a string of characters to be typed while any number of control keys (e.g. esc, alt, shift, ctrl, ...) are held down. All other blocks are specializations of this block.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Press Control Keys&#039;&#039;&#039; e.g. allows you to enter key commands such as renaming files (ALT+F2), starting the task manager (CTRL+ALT+DEL), or closing a window (ALT+F4). &#039;&#039;&#039;Press Control Key&#039;&#039;&#039; makes it easy to just press a single key (e.g. RETURN to start a new line in an edit box). The &#039;&#039;&#039;Shortcuts&#039;&#039;&#039; group provides an assorted collection of often used key combinations for your convenience.&lt;br /&gt;
&lt;br /&gt;
Use the &#039;&#039;&#039;Type&#039;&#039;&#039; to just type some text or, if you just need some throwaway demo text, use &#039;&#039;&#039;Type Random Phrase&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you need more fine grained control over the keyboard, you can make use of &#039;&#039;&#039;Scan Codes&#039;&#039;&#039;. The keyboard sends a scan codeto the operating system whenever a key is pressed or released. &lt;br /&gt;
Microsoft provides a list of the scan codes it supports [https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa299374(v=vs.60)].&lt;br /&gt;
&#039;&#039;&#039;Press Key By Scan Code&#039;&#039;&#039; sends Windows a signal that a key with a given scan code has been pressed (and is hold down). The matching &#039;&#039;&#039;Release Key By Scan Code&#039;&#039;&#039; sends Windows the adverse signal.&lt;br /&gt;
Please note that a key that is pressed, stays pressed until it is explicitly released. If you want to just press and release a key by scan code, use &#039;&#039;&#039;Type Key By Scan Code&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Mouse ===&lt;br /&gt;
The plugin provides blocks manipulating the mouse in three ways: &#039;&#039;&#039;Clicking&#039;&#039;&#039;, &#039;&#039;&#039;Moving&#039;&#039;&#039;, and interacting with its &#039;&#039;&#039;Buttons&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Recording and Taking Screenshots ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Frequently Asked Questions =&lt;br /&gt;
&lt;br /&gt;
== What is the difference between Click/Invoke/Select/Toggle? ==&lt;br /&gt;
&lt;br /&gt;
== My element supports a certain pattern but blocks of that pattern don&#039;t work? ==&lt;br /&gt;
&lt;br /&gt;
== I have designed custom elements, how can I automate them? ==&lt;br /&gt;
&lt;br /&gt;
== I have extended my GUI elements to have custom properties, how can I query them? ==&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11427</id>
		<title>WindowsAutomation Reference 2.0</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11427"/>
		<updated>2018-05-30T12:07:08Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the documentation for the Windows Automation 2.0 plugin.&lt;br /&gt;
&lt;br /&gt;
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
*Automated GUI testing of WPF, WinForms, and Win32 applications.&lt;br /&gt;
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.&lt;br /&gt;
*Parallel remote test-execution on multiple systems.&lt;br /&gt;
*Performs tests against already built executables. No source code changes / recompilation of the application is required.&lt;br /&gt;
*Access to GUI components using XPath locators.&lt;br /&gt;
*Access objects of the application live at execution time.&lt;br /&gt;
*Full access to keyboard and mouse of the target system.&lt;br /&gt;
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...&lt;br /&gt;
&lt;br /&gt;
=Installation and Connection=&lt;br /&gt;
The WindowsAutomation testing plugin uses the expecoo &amp;quot;.NET-Bridge&amp;quot; which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
On the machine running the system under test:&lt;br /&gt;
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.&lt;br /&gt;
* One of the following operation systems:&lt;br /&gt;
::- Windows 7 SP1&lt;br /&gt;
::- Windows 8&lt;br /&gt;
::- Windows 8.1&lt;br /&gt;
::- Windows 10&lt;br /&gt;
&lt;br /&gt;
::- Windows Server 2008 R2 SP1&lt;br /&gt;
::- Windows Server 2012&lt;br /&gt;
::- Windows Server 2012 R2&lt;br /&gt;
::- Windows Server 2016&lt;br /&gt;
::- Windows Server, version 1709&lt;br /&gt;
&lt;br /&gt;
==Plugin Components==&lt;br /&gt;
The plugin consists of the following parts:&lt;br /&gt;
* The GUI Browser, used to interactively explore your application.&lt;br /&gt;
* The Windows Automation Library, which provides blocks that you can use in your test cases.&lt;br /&gt;
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.&lt;br /&gt;
&lt;br /&gt;
==Installing and Configuring the Plugin in Expecco==&lt;br /&gt;
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the &amp;quot;plugin&amp;quot; subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Preparing a local system for test execution==&lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Everything should work out of the box.&lt;br /&gt;
&lt;br /&gt;
TODO: Is that still true with the gui browser?&lt;br /&gt;
TODO: Pictures for the connection process&lt;br /&gt;
&lt;br /&gt;
==Preparing a remote system for test exeuction==&lt;br /&gt;
The remote system will have to run the &amp;quot;.Net-Bridge server&amp;quot; which in turn connects to expecco. &lt;br /&gt;
You just need to copy &amp;quot;DotNetBridgeServer.exe&amp;quot; to the computer your system under test is running on. No further installation is needed.&lt;br /&gt;
&lt;br /&gt;
To start the bridge, navigate to the executable in a shell and start it with the following arguments:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Arguments !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| -s || Yes || Tells the executable to run in server mode (as opposed to client mode).&lt;br /&gt;
|-&lt;br /&gt;
| -k || Yes || Tells the client to keep the connection open after aconnection has been terminated saving you the hassle to restart it every time a test finishes.&lt;br /&gt;
|-&lt;br /&gt;
| -a &amp;lt;ip/hostname&amp;gt;|| Yes || The IP-Address of the PC your application is running on.&lt;br /&gt;
|-&lt;br /&gt;
| -p &amp;lt;int&amp;gt; || No || The port the server should listen on (default is 34318).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
TODO: What settings does the plugin have?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GUI Browser=&lt;br /&gt;
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description also see [[Expecco GUI Tests Extension Reference|Gui Browser]].&lt;br /&gt;
&lt;br /&gt;
=Library=&lt;br /&gt;
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.&lt;br /&gt;
&lt;br /&gt;
== Connecting to an Application ==&lt;br /&gt;
To automate an application, you first have to connect to it. You can do this with the&lt;br /&gt;
blocks from the &#039;&#039;&#039;Connecting&#039;&#039;&#039; group.&lt;br /&gt;
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library&#039;s Connection Blocks.]]&lt;br /&gt;
&lt;br /&gt;
You can connect to an application by its &#039;&#039;&#039;executable name&#039;&#039;&#039;, or by its &#039;&#039;&#039;process id&#039;&#039;&#039;. &lt;br /&gt;
If you use the executable name, expecco will attach to the main process of the specified executable. Be careful as this is not necessarily the process &lt;br /&gt;
drawing the GUI! Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.&lt;br /&gt;
All connection blocks also require you to specify a &#039;&#039;&#039;name&#039;&#039;&#039; by which the connection should be known in future.&lt;br /&gt;
This is needed for when you automate multiple applications at the same time and need to change&lt;br /&gt;
&#039;&#039;&#039;connection contexts&#039;&#039;&#039; during test execution.&lt;br /&gt;
Please note that the application to connect to has to be started before the corresponding connection block is executed.&lt;br /&gt;
You can change in context of which connection a block is executed with the &#039;&#039;&#039;Set Active Connection&#039;&#039;&#039; block.&lt;br /&gt;
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Local Connection === &lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Just use the &#039;&#039;&#039;Create Local Connection&#039;&#039;&#039; with the mentioned above parameters.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Remote Connection ===&lt;br /&gt;
Make sure that the DotNet Bridge server is started as explained in [[#Preparing a remote system for test exeuction]]&lt;br /&gt;
When the bridge is running, you can connect to it with the &#039;&#039;&#039;Create Remote Connection&#039;&#039;&#039; block using the hostname and IP-Address you specified when you started the bridge.&lt;br /&gt;
&lt;br /&gt;
=== Closing a Connection ===&lt;br /&gt;
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.&lt;br /&gt;
One simple way to do this is to setup your connections in the &#039;&#039;&#039;Before Execution&#039;&#039;&#039; part of the test suite&lt;br /&gt;
and put the &#039;&#039;&#039;Close All Connections&#039;&#039;&#039; block in the &#039;&#039;&#039;After exeuction&#039;&#039;&#039; part.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Accessing GUI Elements ==&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library&#039;s GUI Element Access Blocks.]]&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksExamples.PNG|frame|A Few Examples on How to Access Elements in Notepad.]]&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksModes.PNG|frame|Different Ways to Reference a GUI Element.]]&lt;br /&gt;
All Windows applications are built as a &#039;&#039;&#039; tree&#039;&#039;&#039;  of &#039;&#039;&#039; GUI elements&#039;&#039;&#039; .&lt;br /&gt;
Some elements act as container of other element - their children. Tables, for example, are containers&lt;br /&gt;
for their cell elements which themselves might contain text labels.&lt;br /&gt;
At the root of the tree are one or more &#039;&#039;&#039;windows&#039;&#039;&#039; . When you connect to an application, you get access to&lt;br /&gt;
all windows at the tree&#039;s root.&lt;br /&gt;
To manipulate any of the system under test&#039;s GUI element, you first have to gain access to it.&lt;br /&gt;
The group &#039;&#039;&#039;GUI Element Access&#039;&#039;&#039;  provides blocks that help you to gain access to the elements. There are 12 blocks in total, divided between &#039;&#039;&#039; Access By XPath&#039;&#039;&#039; , &#039;&#039;&#039;Access By Property&#039;&#039;&#039;,&lt;br /&gt;
and &#039;&#039;&#039;Existence Test&#039;&#039;&#039;. For each category, blocks with the same interface exist. The only difference is the method of retrival.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Element : returns a &#039;&#039;&#039;single&#039;&#039;&#039; GUI Element matching the search condition. If multiple match the condition, an &#039;&#039;&#039;arbitrary&#039;&#039;&#039; element matching the condition is returned.&lt;br /&gt;
:If you want to make sure that there is only one element matching, set &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039;  to true. You can also enforce this globally by setting the environment variable &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039; in your environment. &lt;br /&gt;
:If ensureExclusive is set and more than one element is found, the block will fail and notify you of the ambiguity. This is disabled by default as checking for uniqueness is a very costly operation.&lt;br /&gt;
:You can also specify a &#039;&#039;&#039;timeout&#039;&#039;&#039; after which the search is aborted. This is useful if you know an element should be there soon but might currently be loading.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Elements: returns &#039;&#039;&#039;all&#039;&#039;&#039; GUI Element matching the search condition. If no element is found, it returns an empty list &amp;lt;b&amp;gt; Timeout &amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;cacheXPath&amp;lt;/b&amp;gt; are also applicable.&lt;br /&gt;
&lt;br /&gt;
;Exists: Works exactly the same as &#039;&#039;&#039;Get GUI Element&#039;&#039;&#039; but does not fail if no element can be found. Additionally provides an output pin specifying if an element has been found.&lt;br /&gt;
&lt;br /&gt;
Both of these blocks are also available in the &#039;&#039;&#039;Relative To Anchor&#039;&#039;&#039; variety. Those blocks also take a GUI Element as &#039;&#039;&#039;anchor&#039;&#039;&#039; in relation to which they search. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Using XPaths ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;XPath&#039;&#039;&#039; is the query language this plugin uses for selecting GUI elements in the application&#039;s element tree.&lt;br /&gt;
You can find the XPath of an element with the [[Expecco GUI Tests Extension Reference|Gui Browser]] or with third-party applications like Inspect.exe [https://msdn.microsoft.com/en-us/library/dd318521(v=vs.85).aspx] or FlaUInspect [https://github.com/FlauTech/FlaUInspect].&lt;br /&gt;
An &#039;&#039;&#039;XPath&#039;&#039;&#039; for the scroll button on the &lt;br /&gt;
vertical scrollbar in the german Windows Notepad application looks like this:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;]/Document[@Name=&#039;Text-Editor&#039;]/ScrollBar[@Name=&#039;Vertikale Bildlaufleiste&#039;]/Button[@Name=&#039;Bildlauf nach unten&#039;] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each level in the GUI tree, a new &amp;lt;b&amp;gt;Location Step&amp;lt;/b&amp;gt; containing the child elements &amp;lt;b&amp;gt;Control Type&amp;lt;/b&amp;gt; has to be added.&lt;br /&gt;
You do not have to use any predicates, the following XPath is valid as well:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window/Document/ScrollBar/Button &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but might lead to issues as there might be multiple GUI Elements matching this path.&lt;br /&gt;
You can select by three predicates that can be mixed and matched in the same query:&lt;br /&gt;
&lt;br /&gt;
; Name: the name the application developer has given an element. Be careful as this name might change during programm execution (See for example Notepad&#039;s window name which always begins with the name of the currently opened file.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
; AutomationId: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced.&lt;br /&gt;
: Many developersleave the ID empty or reuse it, making it useless. You should nontheless use this ID wherever applicable as it is static&lt;br /&gt;
: and meant for this exact purpose.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;List Index: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[last()] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please Note&#039;&#039;&#039;: You can &#039;&#039;&#039;only&#039;&#039;&#039; use the three predicates above in your XPaths. Other predicates &#039;&#039;&#039;DO NOT&#039;&#039;&#039; work! If you want to search&lt;br /&gt;
an element by another property (e.g. its help text), use the &#039;&#039;&#039;By Property&#039;&#039;&#039; variant of the block instead. If the property is not unique,&lt;br /&gt;
you can select a unique ancestor of the target by property or XPath relative to which the property is unique.&lt;br /&gt;
You can then use that ancestor as anchor in the &#039;&#039;&#039;Get GUI Element By Property (Relative to Anchor)&#039;&#039;&#039; block.&lt;br /&gt;
&lt;br /&gt;
=== Using Wildcards in XPaths ===&lt;br /&gt;
&lt;br /&gt;
XPath also supports &#039;&#039;&#039;wildcards&#039;&#039;&#039;. You can:&lt;br /&gt;
* replace &#039;&#039;&#039;one tree level&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard: &lt;br /&gt;
&amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;]/*/Button[1]&amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/*/*/*/Button[1] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace a &#039;&#039;&#039;control type&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;/Window/*[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace &#039;&#039;&#039;an arbitrary amount of tree levels&#039;&#039;&#039; with a &amp;quot;//&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;//Button &amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/Window//Button[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Especially the last option is useful as it makes your tests &amp;lt;b&amp;gt;more readable&amp;lt;/b&amp;gt; as the reader can easily focus on the relevant parts of the xpath.&lt;br /&gt;
But be careful. Using wildcards comes at a steep &amp;lt;b&amp;gt;performance cost&amp;lt;/b&amp;gt;. If your tests run unacceptably slow, first try to &#039;&#039;&#039;remove wildcards where they are not needed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Using Properties===&lt;br /&gt;
&lt;br /&gt;
You can also search for elements by property by specifying a value an element&#039;s property with the given name must have. For a list of properties a GUI element might have, take a look at Microsoft&#039;s documentation [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]. It specifies the supported properties for each pattern an element can support.&lt;br /&gt;
&lt;br /&gt;
=== XPath Resolution in Action Blocks ===&lt;br /&gt;
&lt;br /&gt;
Getting a reference to the GUI Element everytime you need to manipulate it in any way can make for very unclean looking test suites as two blocks are needed to perform any action - one for getting a reference to the element and another one for perform the action. The library therefore also allows you to directly feed an xpath into every block that would take a reference to a GUI Element.&lt;br /&gt;
&lt;br /&gt;
The image on the right shows this mode in action. Variants 1 and 2 are functionally equivalent.&lt;br /&gt;
While Variant 2 is more concise, Variant 1 is the right choice in most cases. While it has an additional block, you have control over the other input parameters. &lt;br /&gt;
You also can recycle the GUI element reference as seen in 3). This is invaluable as the XPath only has to be resolved once. This speeds up test execution by a lot as XPath resolution is very expensive operation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rule of thumb&#039;&#039;&#039;: Always use Variant 1 except if you need the reference to the GUI element only once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Interacting with GUI Elements ==&lt;br /&gt;
Once you retrieved a GUI element, you can interact with it by making use of the library&#039;s blocks located in the groups &#039;&#039;&#039;Elements&#039;&#039;&#039;, &#039;&#039;&#039;Patterns&#039;&#039;&#039;, and &#039;&#039;&#039;Properties&#039;&#039;&#039;. &lt;br /&gt;
Blocks in those categories take a GUI Element (and sometimes additional data) as input and manipulate it or query for its properties in some way.&lt;br /&gt;
&lt;br /&gt;
[[Bild:WindowsAutomation_Library_ElementsPatternsProperties.png|frame|The Library&#039;s Blocks for Interacting With Elements.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The &#039;Elements&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
This group contains blocks that are applicable to blocks that only work on &#039;&#039;&#039;GUI elements of a specific type&#039;&#039;&#039;. For a block&#039;s detailed description with examples ,&lt;br /&gt;
take a look at the block&#039;s documentation in expecco.&lt;br /&gt;
&lt;br /&gt;
Even though not only Checkboxes can be &#039;checked&#039;, the &#039;&#039;&#039;Check&#039;&#039;&#039; block in the &#039;&#039;&#039;Checkbox group&#039;&#039;&#039; only works for checkboxes and not e.g. for radio buttons. &lt;br /&gt;
Because of this limitation there are not that many blocks targeting specific elements. Most blocks target a specific &#039;&#039;&#039;pattern&#039;&#039;&#039; instead and are therefore in the &#039;&#039;&#039;Patterns&#039;&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
=== The &#039;Patterns&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
This group contains blocks that are applicable to GUI elements supporting a certain &#039;&#039;&#039;pattern&#039;&#039;&#039;. &#039;&#039;&#039;Patterns&#039;&#039;&#039; describe how a GUI element &#039;&#039;&#039;behaves&#039;&#039;&#039; rather than what it &#039;&#039;&#039;is&#039;&#039;&#039;. An element can also support multiple patterns&lt;br /&gt;
at the same time. You can find out which patterns an element supports with the &#039;&#039;&#039;Get Supported Patterns&#039;&#039;&#039; block or by taking a look at Microsoft&#039;s documentation about patterns [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview].&lt;br /&gt;
&lt;br /&gt;
Pattern blocks can therefore be &#039;&#039;&#039;re-used&#039;&#039;&#039; between GUI elements of different types. The &#039;&#039;&#039;Expand&#039;&#039;&#039; block of the &#039;&#039;&#039;ExpandCollapse pattern&#039;&#039;&#039;, for example, can be used to expand Comboboxes, Menus, Submenus, or Trees.&lt;br /&gt;
&lt;br /&gt;
=== The &#039;Properties&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
Blocks in the &#039;&#039;&#039;Patterns&#039;&#039;&#039; and &#039;&#039;&#039;Elements&#039;&#039;&#039; group already allow you to query the value of properties pertaining to that element or pattern. Blocks of the &#039;&#039;&#039;Properties&#039;&#039;&#039; group allow you to query properties all elements share as well as arbitrary properties. If you try to retrieve a property an element does not support, the block will fail.&lt;br /&gt;
&lt;br /&gt;
Please note that the &#039;&#039;&#039;Get Arbitrary Property&#039;&#039;&#039; block can only query for properties that belong to a pattern. You cannot, for example, query &amp;quot;Text&amp;quot; from a textfield as this is not a property, use &amp;quot;Value&amp;quot; of the value pattern instead. Microsoft&#039;s documentation has a list of patterns and the properties they provide [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Automating Keyboard and Mouse ==&lt;br /&gt;
[[Bild:WindowsAutomation_Library_KeyboardMouse.png|frame|The Library&#039;s Blocks for Interacting With Keyboard and Mouse.]]&lt;br /&gt;
&lt;br /&gt;
You can control keyboard and mouse with the blocks in the groups &#039;&#039;&#039;Keyboard&#039;&#039;&#039; and &#039;&#039;&#039;Mouse&#039;&#039;&#039; that can be seen on the right. In contrast to the blocks above which work in context of a GUI element, the keyboard and mouse blocks work on a global level. You therefore do not need to provide a GUI element when using them. &lt;br /&gt;
&lt;br /&gt;
You might want to execute some blocks in context of a GUI elemenet nontheless (e.g. enter a number into a text field instead of just pressing keys while the application is running). You can achieve this by selecting the element with the mouse beforehand as you would do when using the application normally (use the &#039;&#039;&#039;Left/Double/Right Click On Element&#039;&#039;&#039; blocks for this).&lt;br /&gt;
If you do not want to wait for the mouse to move, you can also use the &#039;&#039;&#039;Set Focus&#039;&#039;&#039; block instead.&lt;br /&gt;
&lt;br /&gt;
===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Frequently Asked Questions =&lt;br /&gt;
&lt;br /&gt;
== What is the difference between Click/Invoke/Select/Toggle? ==&lt;br /&gt;
&lt;br /&gt;
== My element supports a certain pattern but blocks of that pattern don&#039;t work? ==&lt;br /&gt;
&lt;br /&gt;
== I have designed custom elements, how can I automate them? ==&lt;br /&gt;
&lt;br /&gt;
== I have extended my GUI elements to have custom properties, how can I query them? ==&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_KeyboardMouse.png&amp;diff=11418</id>
		<title>Datei:WindowsAutomation Library KeyboardMouse.png</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_KeyboardMouse.png&amp;diff=11418"/>
		<updated>2018-05-30T11:43:36Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11317</id>
		<title>WindowsAutomation Reference 2.0</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11317"/>
		<updated>2018-05-30T09:09:21Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the documentation for the Windows Automation 2.0 plugin.&lt;br /&gt;
&lt;br /&gt;
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
*Automated GUI testing of WPF, WinForms, and Win32 applications.&lt;br /&gt;
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.&lt;br /&gt;
*Parallel remote test-execution on multiple systems.&lt;br /&gt;
*Performs tests against already built executables. No source code changes / recompilation of the application is required.&lt;br /&gt;
*Access to GUI components using XPath locators.&lt;br /&gt;
*Access objects of the application live at execution time.&lt;br /&gt;
*Full access to keyboard and mouse of the target system.&lt;br /&gt;
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...&lt;br /&gt;
&lt;br /&gt;
=Installation and Connection=&lt;br /&gt;
The WindowsAutomation testing plugin uses the expecoo &amp;quot;.NET-Bridge&amp;quot; which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
On the machine running the system under test:&lt;br /&gt;
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.&lt;br /&gt;
* One of the following operation systems:&lt;br /&gt;
::- Windows 7 SP1&lt;br /&gt;
::- Windows 8&lt;br /&gt;
::- Windows 8.1&lt;br /&gt;
::- Windows 10&lt;br /&gt;
&lt;br /&gt;
::- Windows Server 2008 R2 SP1&lt;br /&gt;
::- Windows Server 2012&lt;br /&gt;
::- Windows Server 2012 R2&lt;br /&gt;
::- Windows Server 2016&lt;br /&gt;
::- Windows Server, version 1709&lt;br /&gt;
&lt;br /&gt;
==Plugin Components==&lt;br /&gt;
The plugin consists of the following parts:&lt;br /&gt;
* The GUI Browser, used to interactively explore your application.&lt;br /&gt;
* The Windows Automation Library, which provides blocks that you can use in your test cases.&lt;br /&gt;
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.&lt;br /&gt;
&lt;br /&gt;
==Installing and Configuring the Plugin in Expecco==&lt;br /&gt;
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the &amp;quot;plugin&amp;quot; subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Preparing a local system for test execution==&lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Everything should work out of the box.&lt;br /&gt;
&lt;br /&gt;
TODO: Is that still true with the gui browser?&lt;br /&gt;
TODO: Pictures for the connection process&lt;br /&gt;
&lt;br /&gt;
==Preparing a remote system for test exeuction==&lt;br /&gt;
The remote system will have to run the &amp;quot;.Net-Bridge server&amp;quot; which in turn connects to expecco. &lt;br /&gt;
You just need to copy &amp;quot;DotNetBridgeServer.exe&amp;quot; to the computer your system under test is running on. No further installation is needed.&lt;br /&gt;
&lt;br /&gt;
To start the bridge, navigate to the executable in a shell and start it with the following arguments:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Arguments !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| -s || Yes || Tells the executable to run in server mode (as opposed to client mode).&lt;br /&gt;
|-&lt;br /&gt;
| -k || Yes || Tells the client to keep the connection open after aconnection has been terminated saving you the hassle to restart it every time a test finishes.&lt;br /&gt;
|-&lt;br /&gt;
| -a &amp;lt;ip/hostname&amp;gt;|| Yes || The IP-Address of the PC your application is running on.&lt;br /&gt;
|-&lt;br /&gt;
| -p &amp;lt;int&amp;gt; || No || The port the server should listen on (default is 34318).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
TODO: What settings does the plugin have?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GUI Browser=&lt;br /&gt;
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description also see [[Expecco GUI Tests Extension Reference|Gui Browser]].&lt;br /&gt;
&lt;br /&gt;
=Library=&lt;br /&gt;
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.&lt;br /&gt;
&lt;br /&gt;
== Connecting to an Application ==&lt;br /&gt;
To automate an application, you first have to connect to it. You can do this with the&lt;br /&gt;
blocks from the &#039;&#039;&#039;Connecting&#039;&#039;&#039; group.&lt;br /&gt;
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library&#039;s Connection Blocks.]]&lt;br /&gt;
&lt;br /&gt;
You can connect to an application by its &#039;&#039;&#039;executable name&#039;&#039;&#039;, or by its &#039;&#039;&#039;process id&#039;&#039;&#039;. &lt;br /&gt;
If you use the executable name, expecco will attach to the main process of the specified executable. Be careful as this is not necessarily the process &lt;br /&gt;
drawing the GUI! Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.&lt;br /&gt;
All connection blocks also require you to specify a &#039;&#039;&#039;name&#039;&#039;&#039; by which the connection should be known in future.&lt;br /&gt;
This is needed for when you automate multiple applications at the same time and need to change&lt;br /&gt;
&#039;&#039;&#039;connection contexts&#039;&#039;&#039; during test execution.&lt;br /&gt;
Please note that the application to connect to has to be started before the corresponding connection block is executed.&lt;br /&gt;
You can change in context of which connection a block is executed with the &#039;&#039;&#039;Set Active Connection&#039;&#039;&#039; block.&lt;br /&gt;
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Local Connection === &lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Just use the &#039;&#039;&#039;Create Local Connection&#039;&#039;&#039; with the mentioned above parameters.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Remote Connection ===&lt;br /&gt;
Make sure that the DotNet Bridge server is started as explained in [[#Preparing a remote system for test exeuction]]&lt;br /&gt;
When the bridge is running, you can connect to it with the &#039;&#039;&#039;Create Remote Connection&#039;&#039;&#039; block using the hostname and IP-Address you specified when you started the bridge.&lt;br /&gt;
&lt;br /&gt;
=== Closing a Connection ===&lt;br /&gt;
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.&lt;br /&gt;
One simple way to do this is to setup your connections in the &#039;&#039;&#039;Before Execution&#039;&#039;&#039; part of the test suite&lt;br /&gt;
and put the &#039;&#039;&#039;Close All Connections&#039;&#039;&#039; block in the &#039;&#039;&#039;After exeuction&#039;&#039;&#039; part.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Accessing GUI Elements ==&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library&#039;s GUI Element Access Blocks.]]&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksExamples.PNG|frame|A Few Examples on How to Access Elements in Notepad.]]&lt;br /&gt;
All Windows applications are built as a &#039;&#039;&#039; tree&#039;&#039;&#039;  of &#039;&#039;&#039; GUI elements&#039;&#039;&#039; .&lt;br /&gt;
Some elements act as container of other element - their children. Tables, for example, are containers&lt;br /&gt;
for their cell elements which themselves might contain text labels.&lt;br /&gt;
At the root of the tree are one or more &#039;&#039;&#039;windows&#039;&#039;&#039; . When you connect to an application, you get access to&lt;br /&gt;
all windows at the tree&#039;s root.&lt;br /&gt;
To manipulate any of the system under test&#039;s GUI element, you first have to gain access to it.&lt;br /&gt;
The group &#039;&#039;&#039;GUI Element Access&#039;&#039;&#039;  provides blocks that help you to gain access to the elements. There are 12 blocks in total, divided between &#039;&#039;&#039; Access By XPath&#039;&#039;&#039; , &#039;&#039;&#039;Access By Property&#039;&#039;&#039;,&lt;br /&gt;
and &#039;&#039;&#039;Existence Test&#039;&#039;&#039;. For each category, blocks with the same interface exist. The only difference is the method of retrival.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Element : returns a &#039;&#039;&#039;single&#039;&#039;&#039; GUI Element matching the search condition. If multiple match the condition, an &#039;&#039;&#039;arbitrary&#039;&#039;&#039; element matching the condition is returned.&lt;br /&gt;
:If you want to make sure that there is only one element matching, set &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039;  to true. You can also enforce this globally by setting the environment variable &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039; in your environment. &lt;br /&gt;
:If ensureExclusive is set and more than one element is found, the block will fail and notify you of the ambiguity. This is disabled by default as checking for uniqueness is a very costly operation.&lt;br /&gt;
:You can also specify a &#039;&#039;&#039;timeout&#039;&#039;&#039; after which the search is aborted. This is useful if you know an element should be there soon but might currently be loading.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Elements: returns &#039;&#039;&#039;all&#039;&#039;&#039; GUI Element matching the search condition. If no element is found, it returns an empty list &amp;lt;b&amp;gt; Timeout &amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;cacheXPath&amp;lt;/b&amp;gt; are also applicable.&lt;br /&gt;
&lt;br /&gt;
;Exists: Works exactly the same as &#039;&#039;&#039;Get GUI Element&#039;&#039;&#039; but does not fail if no element can be found. Additionally provides an output pin specifying if an element has been found.&lt;br /&gt;
&lt;br /&gt;
Both of these blocks are also available in the &#039;&#039;&#039;Relative To Anchor&#039;&#039;&#039; variety. Those blocks also take a GUI Element as &#039;&#039;&#039;anchor&#039;&#039;&#039; in relation to which they search. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Using XPaths ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;XPath&#039;&#039;&#039; is the query language this plugin uses for selecting GUI elements in the application&#039;s element tree.&lt;br /&gt;
You can find the XPath of an element with the [[Expecco GUI Tests Extension Reference|Gui Browser]] or with third-party applications like Inspect.exe [https://msdn.microsoft.com/en-us/library/dd318521(v=vs.85).aspx] or FlaUInspect [https://github.com/FlauTech/FlaUInspect].&lt;br /&gt;
An &#039;&#039;&#039;XPath&#039;&#039;&#039; for the scroll button on the &lt;br /&gt;
vertical scrollbar in the german Windows Notepad application looks like this:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;]/Document[@Name=&#039;Text-Editor&#039;]/ScrollBar[@Name=&#039;Vertikale Bildlaufleiste&#039;]/Button[@Name=&#039;Bildlauf nach unten&#039;] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each level in the GUI tree, a new &amp;lt;b&amp;gt;Location Step&amp;lt;/b&amp;gt; containing the child elements &amp;lt;b&amp;gt;Control Type&amp;lt;/b&amp;gt; has to be added.&lt;br /&gt;
You do not have to use any predicates, the following XPath is valid as well:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window/Document/ScrollBar/Button &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but might lead to issues as there might be multiple GUI Elements matching this path.&lt;br /&gt;
You can select by three predicates that can be mixed and matched in the same query:&lt;br /&gt;
&lt;br /&gt;
; Name: the name the application developer has given an element. Be careful as this name might change during programm execution (See for example Notepad&#039;s window name which always begins with the name of the currently opened file.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
; AutomationId: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced.&lt;br /&gt;
: Many developersleave the ID empty or reuse it, making it useless. You should nontheless use this ID wherever applicable as it is static&lt;br /&gt;
: and meant for this exact purpose.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;List Index: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[last()] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Using Wildcards in XPaths ===&lt;br /&gt;
&lt;br /&gt;
XPath also supports &#039;&#039;&#039;wildcards&#039;&#039;&#039;. You can:&lt;br /&gt;
* replace &#039;&#039;&#039;one tree level&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard: &lt;br /&gt;
&amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;]/*/Button[1]&amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/*/*/*/Button[1] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace a &#039;&#039;&#039;control type&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;/Window/*[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace &#039;&#039;&#039;an arbitrary amount of tree levels&#039;&#039;&#039; with a &amp;quot;//&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;//Button &amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/Window//Button[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Especially the last option is useful as it makes your tests &amp;lt;b&amp;gt;more readable&amp;lt;/b&amp;gt; as the reader can easily focus on the relevant parts of the xpath.&lt;br /&gt;
But be careful. Using wildcards comes at a steep &amp;lt;b&amp;gt;performance cost&amp;lt;/b&amp;gt;. If your tests run unacceptably slow, first try to &#039;&#039;&#039;remove wildcards where they are not needed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Using Properties===&lt;br /&gt;
&lt;br /&gt;
You can also search for elements by property by specifying a value an element&#039;s property with the given name must have. For a list of properties a GUI element might have, take a look at Microsoft&#039;s documentation [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]. It specifies the supported properties for each pattern an element can support.&lt;br /&gt;
&lt;br /&gt;
=== XPath Resolution in Action Blocks ===&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksModes.PNG|frame|Different Ways to Reference a GUI Element.]]&lt;br /&gt;
Getting a reference to the GUI Element everytime you need to manipulate it in any way can make for very unclean looking test suites as two blocks are needed to perform any action - one for getting a reference to the element and another one for perform the action. The library therefore also allows you to directly feed an xpath into every block that would take a reference to a GUI Element.&lt;br /&gt;
&lt;br /&gt;
The image on the right shows this mode in action. Variants 1 and 2 are functionally equivalent.&lt;br /&gt;
While Variant 2 is more concise, Variant 1 is the right choice in most cases. While it has an additional block, you have control over the other input parameters. &lt;br /&gt;
You also can recycle the GUI element reference as seen in 3). This is invaluable as the XPath only has to be resolved once. This speeds up test execution by a lot as XPath resolution is very expensive operation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rule of thumb&#039;&#039;&#039;: Always use Variant 1 except if you need the reference to the GUI element not more than once during test execution.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Interacting with GUI Elements ==&lt;br /&gt;
Once you retrieved a GUI element, you can interact with it by making use of the library&#039;s blocks located in the groups &#039;&#039;&#039;Elements&#039;&#039;&#039;, &#039;&#039;&#039;Patterns&#039;&#039;&#039;, and &#039;&#039;&#039;Properties&#039;&#039;&#039;. &lt;br /&gt;
Blocks in those categories take a GUI Element (and sometimes additional data) as input and manipulate it or query for its properties in some way.&lt;br /&gt;
&lt;br /&gt;
[[Bild:WindowsAutomation_Library_ElementsPatternsProperties.png|frame|The Library&#039;s Blocks for Interacting With Elements.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The &#039;Elements&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
This group contains blocks that are applicable to blocks that only work on &#039;&#039;&#039;GUI elements of a specific type&#039;&#039;&#039;. For a block&#039;s detailed description with examples ,&lt;br /&gt;
take a look at the block&#039;s documentation in expecco.&lt;br /&gt;
&lt;br /&gt;
Even though not only Checkboxes can be &#039;checked&#039;, the &#039;&#039;&#039;Check&#039;&#039;&#039; block in the &#039;&#039;&#039;Checkbox group&#039;&#039;&#039; only works for checkboxes and not e.g. for radio buttons. &lt;br /&gt;
Because of this limitation there are not that many blocks targeting specific elements. Most blocks target a specific &#039;&#039;&#039;pattern&#039;&#039;&#039; instead and are therefore in the &#039;&#039;&#039;Patterns&#039;&#039;&#039; group.&lt;br /&gt;
&lt;br /&gt;
=== The &#039;Patterns&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
This group contains blocks that are applicable to GUI elements supporting a certain &#039;&#039;&#039;pattern&#039;&#039;&#039;.&lt;br /&gt;
=== The &#039;Properties&#039; Group ===&lt;br /&gt;
&lt;br /&gt;
== Automating Keyboard and Mouse ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Frequently Asked Questions =&lt;br /&gt;
&lt;br /&gt;
== What is the difference between Click/Invoke/Select/Toggle? ==&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_ElementsPatternsProperties.png&amp;diff=11303</id>
		<title>Datei:WindowsAutomation Library ElementsPatternsProperties.png</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_ElementsPatternsProperties.png&amp;diff=11303"/>
		<updated>2018-05-30T08:05:20Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_Elements.PNG&amp;diff=11302</id>
		<title>Datei:WindowsAutomation Library Elements.PNG</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_Elements.PNG&amp;diff=11302"/>
		<updated>2018-05-30T07:38:40Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=Hauptseite/en&amp;diff=11301</id>
		<title>Hauptseite/en</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=Hauptseite/en&amp;diff=11301"/>
		<updated>2018-05-30T05:24:07Z</updated>

		<summary type="html">&lt;p&gt;Lv: /* GUI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= expecco =&lt;br /&gt;
&lt;br /&gt;
== Release Notes ==&lt;br /&gt;
* [[Release Notes expecco/en|Release Notes expecco]]&lt;br /&gt;
&lt;br /&gt;
== General, Overview, Concepts ==&lt;br /&gt;
* [[expecco Overview/en|Overview]]&lt;br /&gt;
* [[Concepts/en|Concepts]] - concepts; testplan, testcase, activities, verdicts&lt;br /&gt;
* [[Glossary/en|Glossary]]&lt;br /&gt;
* [[FAQ/en|FAQ]]&lt;br /&gt;
&lt;br /&gt;
=== Installation, Configuration &amp;amp; Setup ===&lt;br /&gt;
* [[Installation/en|Installation]] - initial installation, license files, patches&lt;br /&gt;
* [[Configuration &amp;amp; Setup/en|Configuration &amp;amp; Setup]] - JRE/JDK setup, paths&lt;br /&gt;
* [[Personal Settings/en|Personal Settings]] - editor settings&lt;br /&gt;
&lt;br /&gt;
=== Command Line and Remote Control Services ===&lt;br /&gt;
* [[Command Line Options/en|Command Line Options and RPC Services]]&lt;br /&gt;
** [[Command Line Options/en#Command_Line|Command Line]]&lt;br /&gt;
** [[Command Line Options/en#Expecco_SOAP_Service_Interface|Remote Control via SOAP]]&lt;br /&gt;
** [[Command Line Options/en#Expecco_REST_Service_Interface|Remote Control via REST]]&lt;br /&gt;
** [[Command Line Options/en#Scripting|Scripting by File or via Telnet]]&lt;br /&gt;
&lt;br /&gt;
=== Report Generation ===&lt;br /&gt;
* [[Report Generation/en|Report Generation]]&lt;br /&gt;
&lt;br /&gt;
== expecco UI ==&lt;br /&gt;
&lt;br /&gt;
* [[General Info on the Expecco UI/en|General Info on the Expecco UI]]&lt;br /&gt;
* [[Menu/en|Menu]]&lt;br /&gt;
* [[Toolbar/en|Toolbar]]&lt;br /&gt;
* [[Navigation Tree/en|Navigation Tree]]&lt;br /&gt;
* [[Settings/en|Settings]]&lt;br /&gt;
* [[Testsuite Browser/en|Testsuite Browser]]&lt;br /&gt;
* [[Expecco Remote Control APP/en|Expecco Remote Control APP]]&lt;br /&gt;
&lt;br /&gt;
==Tree-Elements==&lt;br /&gt;
&lt;br /&gt;
* [[Tree Elements/en|Tree Elements]]&lt;br /&gt;
* [[Folder Element/en|Folder Element]]&lt;br /&gt;
* [[Datatype Element/en|Datatype Element]]&lt;br /&gt;
* [[Testplan Element/en|Testplan Element]]&lt;br /&gt;
* [[Block Element/en|Block Element]]&lt;br /&gt;
** [[ElementaryBlock Element/en|Elementary Block Element]]&lt;br /&gt;
** [[CompoundBlock Element/en|Compound Block Element]]&lt;br /&gt;
** [[KeywordBlock Element/en|KeywordBlock Element]]&lt;br /&gt;
** [[TestDataGeneratorBlock Element/en|TestDataGeneratorBlock Element]]&lt;br /&gt;
** [[VirtualBlock Element/en|Virtual Block Element]]&lt;br /&gt;
** [[UnimplementedBlock Element/en|Unimplemented Block Element]]&lt;br /&gt;
** [[GUIBlock Element/en|GUIBlock Element]]&lt;br /&gt;
* [[Inventory Element/en|Inventory Element]]&lt;br /&gt;
* [[Skill Element/en|Skill Element]]&lt;br /&gt;
* [[Resource Element/en|Resource Element]]&lt;br /&gt;
* [[Attachment Element/en|Attachment Element]]&lt;br /&gt;
* [[ReportTemplate Element/en|ReportTemplate Element]]&lt;br /&gt;
&lt;br /&gt;
== Editors ==&lt;br /&gt;
&lt;br /&gt;
* [[Documentation Editor/en|Documentation Editor]]&lt;br /&gt;
* [[History Editor/en|History Editor]]&lt;br /&gt;
* [[Testsuite Editor/en|Testsuite Editor]]&lt;br /&gt;
** [[Testsuite Editor-Environment Editor/en|Testsuite Editor: Environment Editor]]&lt;br /&gt;
** [[Testsuite Editor-ExecutionSettings Editor/en|Testsuite Editor: Execution Settings Editor]]&lt;br /&gt;
** [[Testsuite Editor-ReportParameter Editor/en|Testsuite Editor: Report Parameter Editor]]&lt;br /&gt;
** [[Testsuite Editor-Metadata Editor/en|Testsuite Editor: Metadata Editor]]&lt;br /&gt;
** [[Testsuite Editor-StatisticData Editor/en|Testsuite Editor: Statistic Data Editor]]&lt;br /&gt;
** [[TestsuiteHistory Editor/en|Testsuite History Editor]]&lt;br /&gt;
* [[Block Editor/en|Block Editor]]&lt;br /&gt;
** [[Scheme Editor/en|Scheme Editor]]&lt;br /&gt;
** [[ElementaryBlock Editor-Code Editor/en|Elementary Block: Code Editor]]&lt;br /&gt;
** [[BlockFunctionalityTestEditor/en|Block Functionality Test Editor]]&lt;br /&gt;
** [[BlockFunctionalityRunner/en|Block Functionality Runner]]&lt;br /&gt;
** [[BlockSkill Editor/en|Block Skill Editor]]&lt;br /&gt;
** [[CompoundBlock Editor-CompoundWorksheet Editor/en|Compound Block: Compound Diagram Editor]]&lt;br /&gt;
** [[CompoundBlock Editor-Environment Editor/en|Compound Block: Environment Editor]]&lt;br /&gt;
** [[KeywordBlock Editor-KeywordActionList Editor/en|Keyword Block: Keyword Action List Editor]]&lt;br /&gt;
** [[TestDataGeneratorBlock Editor-TestData Editor/en|TestData Generator Block: TestData Editor]]&lt;br /&gt;
** [[TableDrivenBlock Editor-Table Editor/en|Table Driven Block: Table Editor]]&lt;br /&gt;
* [[Testplan Editor/en|Testplan Editor]]&lt;br /&gt;
** [[Testplan Editor-TestplanEnvironment Editor/en|Testplan Editor: Testplan Environment Editor]]&lt;br /&gt;
** [[Testplan Editor-TestplanListView Editor/en|Testplan Editor: Testplan List Editor]]&lt;br /&gt;
** [[Testplan Editor-ReportParameter Editor/en|Testplan Editor: Testplan Report Parameter Editor]]&lt;br /&gt;
* [[Datatype Editor/en|Datatype Editor]]&lt;br /&gt;
* [[Inventory Editor/en|Inventory Editor]]&lt;br /&gt;
* [[ReportParameter Editor/en|Report Parameter Editor]]&lt;br /&gt;
* [[Resource Editor/en|Resource Editor]]&lt;br /&gt;
* [[Skill Editor/en|Skill Editor]]&lt;br /&gt;
* [[CategoryContainer Editor/en|Category/Container Editor]]&lt;br /&gt;
* [[Documentation Editor/en|Documentation Editor]]&lt;br /&gt;
* [[Attachment Editor/en|Attachment Editor]]&lt;br /&gt;
** [[FileAttachment Editor/en|File Attachment Editor]]&lt;br /&gt;
** [[URLAttachment Editor/en|URL Attachment Editor]]&lt;br /&gt;
** [[ReportTemplateAttachment Editor/en|Report Template Editor]]&lt;br /&gt;
* [[GUI Editor-GUICode Editor/en|GUI Editor: GUICode Editor]]&lt;br /&gt;
&lt;br /&gt;
==Diagram-Elements==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Achtung: DiagramElements-XXXPin gehen nun alle nach DiagramElements-Pin#typeofPin. Also z.B. DiagramElements-Pin#Enable_Output_pin.&lt;br /&gt;
entsprechende hash-tags müssen in DiagramElements-Pin erhalten bleiben.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* [[DiagramElements-Pin/en|Pin]]&lt;br /&gt;
** [[DiagramElements-Pin/en#Input Pin|Input Pin]]&lt;br /&gt;
*** [[DiagramElements-Pin/en#Enable Input Pin|Enable (Trigger-) Input Pin]]&lt;br /&gt;
*** [[DiagramElements-Pin/en#Cancel Input Pin|Cancel Input Pin]]&lt;br /&gt;
*** [[DiagramElements-Pin/en#Iterate Input Pin|Iterate Input Pin]]&lt;br /&gt;
*** [[DiagramElements-Pin/en#Timelimit Input Pin|Timelimit Input Pin]]&lt;br /&gt;
*** [[DiagramElements-Pin/en#Performer Input Pin|Performer Input Pin]]&lt;br /&gt;
** [[DiagramElements-Pin/en#Output Pin|Output Pin]]&lt;br /&gt;
*** [[DiagramElements-Pin/en#Exception Output Pin|Exception Output Pin]]&lt;br /&gt;
*** [[DiagramElements-Pin/en#Enable Output Pin|Enable (Trigger-)Output Pin]]&lt;br /&gt;
*** [[DiagramElements-Pin/en#ExecutionTime Output Pin|Execution Time Output Pin]]&lt;br /&gt;
* [[DiagramElements-Step/en|Step]]&lt;br /&gt;
** [[DiagramElements-AttachmentStep/en|Attachment Step]]&lt;br /&gt;
* [[DiagramElements-Connection/en|Connection]]&lt;br /&gt;
* [[DiagramElements-PinDescription/en|Pin Description]]&lt;br /&gt;
* [[DiagramElements-Annotation/en|Annotation]]&lt;br /&gt;
* [[DiagramElements-Probe/en|Probe]]&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Debugger ===&lt;br /&gt;
&lt;br /&gt;
* [[Tools Debugger/en|Debugger]]: the internal Debugger&lt;br /&gt;
&lt;br /&gt;
=== Additional tools in the &amp;quot;Extras&amp;quot;-Menu ===&lt;br /&gt;
&lt;br /&gt;
* [[Tools Notepad/en|Notepad]]: A postIt-like text editor and code evaluation window&lt;br /&gt;
&lt;br /&gt;
* [[Tools FileBrowser/en|File Browser]]: A tool to search for and manipulate files and their contents&lt;br /&gt;
&lt;br /&gt;
* [[Tools ClassBrowser/en|Class Browser]]: Expert tool to investigate and manipulate class code&lt;br /&gt;
&lt;br /&gt;
* [[Tools ProcessMonitor/en|Process Monitor]]: A tool to show active execution processes (threads within expecco)&lt;br /&gt;
&lt;br /&gt;
* [[Tools Transcript/en|Transcript]]: A message and trace window&lt;br /&gt;
&lt;br /&gt;
* [[Tools TestSuiteDifferenceBrowser/en|Test Suite Difference Browser]]: To find differences between two test suites&lt;br /&gt;
&lt;br /&gt;
=== Additional functions in the &amp;quot;Extras&amp;quot; Menu ===&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Explorer&amp;quot; / &amp;quot;Explorer In...&amp;quot;: opens a Windows Explorer window on one of the common directories (Windows platform only)&lt;br /&gt;
* &amp;quot;Finder&amp;quot; / &amp;quot;Finder In...&amp;quot;: opens a Finder window on one of the common directories (Mac OSX platform only)&lt;br /&gt;
* Screenshot: generates a file containing a screenshot image (in BMP, PNG or TIFF format)&lt;br /&gt;
* [[Tools ModelTranslationEditor/en|Model Translation Editor]]: To define language-translations for model elements&lt;br /&gt;
* [[Tools ImportScripts/en|Import Shell or Batch Scripts]]: To generate blocks for existing test/automation scripts&lt;br /&gt;
&lt;br /&gt;
=== Low level debug functions found in the &amp;quot;Extras&amp;quot;-&amp;quot;Debugging&amp;quot; Menu ===&lt;br /&gt;
&lt;br /&gt;
* [[ToolsMenuFunctions#ShowAllExternalConnections/en|Show all External Connections]]: To find open handles&lt;br /&gt;
* [[ToolsMenuFunctions#ShutDownBridgeConnections/en|Shut Down Bridge Connections]]: To tear down leftover Java Bridge connections&lt;br /&gt;
* [[ToolsMenuFunctions#CloseAllSocketConnections/en|Close all Socket Connections]]: To tear down leftover Socket (interprocess communication) connections&lt;br /&gt;
* [[ToolsMenuFunctions#CloseAllSerialConnections/en|Close all Serial Connections]]: To tear down leftover Serial connections&lt;br /&gt;
&lt;br /&gt;
* [[ToolsMenuFunctions#ShowMemoryUsageByObjectType/en|Show Memory Usage by Object Type]]: Detailed information about memory usage&lt;br /&gt;
* [[ToolsMenuFunctions#Memory_Cleanup/en|Memory Cleanup]]: Force memory cleanup to release unused resources&lt;br /&gt;
&lt;br /&gt;
== Elementary Block API ==&lt;br /&gt;
* Internal Interpreters - [[Expecco API/en|Expecco API]] - Information for Elementary Block Developers&lt;br /&gt;
** [[Expecco API/en#JavaScript_and_Smalltalk_Elementary_Blocks|JavaScript and Smalltalk Elementary Blocks]]&lt;br /&gt;
&lt;br /&gt;
* External Interpreters&lt;br /&gt;
** [[Expecco API/en#Groovy_Elementary_Blocks|Groovy Elementary Blocks]] -- via a bridge, possibly executed inside the SUT&lt;br /&gt;
** [[Expecco API/en#VisualBasic_Elementary_Blocks|VisualBasic Elementary Blocks]] -- via a bridge, possibly executed inside the SUT&lt;br /&gt;
** [[Python Script Code Execution/en|Python Script Code Execution]] -- Python code in an external Python interpreter&lt;br /&gt;
** [[Node.js Script Code Execution/en|Node.js Script Code Execution]] -- JavaScript code in an external Node.js interpreter&lt;br /&gt;
&lt;br /&gt;
== Standard Library Reference ==&lt;br /&gt;
&lt;br /&gt;
The following libraries are included in the base package.&lt;br /&gt;
No additional extension or plugin is required.&lt;br /&gt;
&lt;br /&gt;
* [[Standard Library/en|Standard Library]] -- A common, domain independent library&lt;br /&gt;
* [[SeleniumLibrary Reference/en|Selenium Library]] -- A library to control web browsers&lt;br /&gt;
* [[XML Library/en|XML Library]] -- A library to parse XML documents and access DOM-tree elements&lt;br /&gt;
* [[Expecco Reflection Library/en|Expecco Reflection Library]] -- A library to automate expecco itself&lt;br /&gt;
&lt;br /&gt;
== Interfacing to the System Under Test ==&lt;br /&gt;
&lt;br /&gt;
* [[COM/OLE/en|COM/OLE]] -- How to invoke COM interfaces&lt;br /&gt;
* [[Corba/en|CORBA]] -- How to invoke CORBA interfaces&lt;br /&gt;
* [[FTP/en|FTP]] -- FTP interface&lt;br /&gt;
* [[HTTP/en|HTTP]] -- HTTP interface&lt;br /&gt;
* [[HTTPS/en|HTTPS]] -- HTTP (SSL) interface&lt;br /&gt;
* [[SOAP/en|SOAP]] -- SOAP interface&lt;br /&gt;
* [[XML-RPC/en|XML-RPC]] -- XML-RPC interface&lt;br /&gt;
* [[REST/en|REST]] -- REST interface&lt;br /&gt;
* [[Telnet/en|Telnet]] -- Telnet interface&lt;br /&gt;
* [[Sockets/en|Sockets]] -- Generic Low Level Socket interfaces&lt;br /&gt;
* [[Pipes/en|Pipes]] -- Pipes&lt;br /&gt;
* [[Shared/en|Shared Memory]] - Shared Memory&lt;br /&gt;
* [[DLL Calls/en|DLL Calls]]&lt;br /&gt;
&lt;br /&gt;
== Plugins and Extensions ==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
==== Web Browser UI Testing ====&lt;br /&gt;
&lt;br /&gt;
* [[Selenium Web Test Plugin/en|Selenium Web Test Plugin]] -- Web Page Tests and Interaction (part of the base package)&lt;br /&gt;
* [[SeleniumLibrary Reference/en|SeleniumLibrary Reference]] -- Library reference&lt;br /&gt;
&lt;br /&gt;
==== GUI Testing ====&lt;br /&gt;
* [[Expecco GUI Tests Extension Reference/en|GUI Browser: Common Extension for GUI Tests]]&amp;lt;br&amp;gt;This extension provides a base for the other UI technology interfaces, and is a prerequisite (included in) the Java GUI, Mobile GUI, Qt and Windows Automation GUI plugins.&lt;br /&gt;
&lt;br /&gt;
* [[Java GUI Plugins/en|Java Swing/SWT UI Testing]]&amp;lt;br&amp;gt;These plugins provide interfaces to Java GUIs based on Swing and/or SWT.&lt;br /&gt;
&lt;br /&gt;
* [[Mobile Testing Plugin/en|Mobile Testing Plugin ]]&amp;lt;br&amp;gt;This plugin interfaces to Android and iOS mobile devices via an Appium access layer.&lt;br /&gt;
&lt;br /&gt;
* [[VNC Plugin Reference/en|UI Testing via VNC]]&amp;lt;br&amp;gt;This plugin interfaces to arbitrary applications via VNC (RFB). This allows for any application to be tested. However, the set of verifiable attributes is very limited. Therefore, this is mostly used as a fallback solution, in case no other UI-plugin is applicable.&lt;br /&gt;
&lt;br /&gt;
* [[Qt Plugin Reference/en|UI Testing von Qt Anwendungen]]&amp;lt;br&amp;gt;This plugin interfaces to Applications using the Qt UI framework.&lt;br /&gt;
&lt;br /&gt;
* [[OpenETS Plugin Reference/en|UI Testing von OpenETS Anwendungen]]&amp;lt;br&amp;gt;This plugin interfaces to Applications using the OpenETS UI framework. OpenETS (&amp;quot;Open Expecco Test Service&amp;quot;) consists of a C library provided by eXept, which can be linked to the program. This library handles the communication with expecco. Using OpenETS, arbitrary C/C++ applications can be automated with expecco.&lt;br /&gt;
&lt;br /&gt;
* [[WindowsAutomation Reference 1.0/en|Windows Automation GUI Access Interfacing Library]]&amp;lt;br&amp;gt;This plugin interfaces to Windows applications via the UI Automation layer.&lt;br /&gt;
&lt;br /&gt;
* [[WindowsAutomation Reference 2.0|UI Testing with the Windows Automation Library]]&amp;lt;br&amp;gt;This plugin realizes access to Windows applications via the UI Automation layer- Version 2.0&lt;br /&gt;
&lt;br /&gt;
* [[AutoIt Library/en|AutoIt GUI Interface Library]]&amp;lt;br&amp;gt;This plugin interfaces to Windows applications via AutoIt. It is very low level, in that only a very limited set of attributes is accessible; however, it works with any window written in any UI framework and is sometimes useful, if no high level attributes (knowledge) about the underlying UI technology is available.&lt;br /&gt;
&lt;br /&gt;
=== Code Execution ===&lt;br /&gt;
* [[Groovy Code Execution Plugin/en|Groovy Code Execution Plugin]] -- allows for Groovy code to be executed locally or inside the SUT&lt;br /&gt;
&lt;br /&gt;
* [[VBScript/en|VisualBasic Script Plugin]] -- allows VisualBasic code to be executed either locally or on the SUT&lt;br /&gt;
&lt;br /&gt;
* [[C# Code Execution/en|C# Code Execution]] -- executes C# code either locally or inside the SUT (.NET famework)&lt;br /&gt;
&lt;br /&gt;
* [[Python Code Execution/en|Python Code Execution]] -- executes IronPython code locally or inside the SUT (.NET framework)&lt;br /&gt;
&lt;br /&gt;
* [[Java Browser/en|Java Browser]] -- allows for Java classes to be browsed in the SUT&lt;br /&gt;
&lt;br /&gt;
* [[Java Debugger/en|Java Debugger]] -- to debug Groovy block and other code executed by the Java Bridge in (remote) JVM&lt;br /&gt;
&lt;br /&gt;
* [[SmallSense/en|SmallSense]] -- together with [[Java Browser/en|Java Browser]] provides basic code completion support for Groovy code.&lt;br /&gt;
&lt;br /&gt;
=== Manual Test Support Plugins ===&lt;br /&gt;
* [[Manual Test Plugin/en|Manual Test Plugin]] -- guides users through manual tests&lt;br /&gt;
* [[Manual Test Import Plugin/en|Manual Test Import Plugin]] -- imports test specifications written in Word or Excel&lt;br /&gt;
&lt;br /&gt;
=== Misc Plugins ===&lt;br /&gt;
* [[GembirdPowerControlPlugin Reference/en|Gembird Power Control Plugin]] -- control a power plug (part of the base package)&lt;br /&gt;
&lt;br /&gt;
=== QM Interface Plugins ===&lt;br /&gt;
* [[PolarionPlugin Reference/en|Polarion Plugin Reference]] - automate execution from &amp;amp; interact with Polarion&lt;br /&gt;
* [[expecco ALM Plugin Reference/en|expecco ALM Plugin Reference]] - automate execution from &amp;amp; interact with expecco ALM&lt;br /&gt;
* [[HP Quality Center Plugin Reference/en|HP Quality Center Plugin Reference]] - automate execution from and interact with HP Quality Center&lt;br /&gt;
* [[Jira Plugin Reference/en|Jira Plugin Reference]] - interact with Jira&lt;br /&gt;
&lt;br /&gt;
=== Specification Import/Export ===&lt;br /&gt;
* [[WSDL Service Import Plugin/en|WSDL Service Import Plugin]] -- import service actions from a WSDL service description&lt;br /&gt;
* [[XMI Diagram Import Plugin/en|XMI Diagram Import Plugin]] -- import XMI activity diagrams from Enterprise Architect&lt;br /&gt;
&lt;br /&gt;
=== Data/Message/Document Formats ===&lt;br /&gt;
* [[ASN.1 Support/en|ASN.1 Support]] -- parse ASN.1 specifications; read/write/verify/modify ASN.1 encoded messages&lt;br /&gt;
* [[GDMO Support/en|GDMO Support]] -- read/write/verify/modify GDMO objects&lt;br /&gt;
* [[DTD XSD Support/en|DTD, XSD Support]] -- read type specifications&lt;br /&gt;
* [[SWIFT Plugin/en|SWIFT Plugin]] -- read/write/verify/modify SWIFT messages&lt;br /&gt;
* [[EDI Edifact Plugin/en|EDI / Edifact Plugin]] -- read/write/verify/modify EDI messages; parse message specifications in various formats;&lt;br /&gt;
* [[EDI Idoc Plugin/en|EDI / Idoc Plugin]] -- to be documented&lt;br /&gt;
* [[EDI X12 Plugin/en|EDI / X12 Plugin]] -- to be documented&lt;br /&gt;
* [[PDF Support/en|PDF Support]] -- read PDF file structure; generate PDF documents&lt;br /&gt;
* [[ODF Support/en|ODF Support]] -- read ODF file structure&lt;br /&gt;
* [[JSON Support/en|JSON Support]] -- encode/decode JSON messages&lt;br /&gt;
* [[PEG Parser/en|PEG Parser]] -- to parse arbitrary messages/texts&lt;br /&gt;
&lt;br /&gt;
=== Communications/Protocols ===&lt;br /&gt;
&lt;br /&gt;
* [[FTP Support/en|FTP Support]] - ftp client / ftp server / sftp client&lt;br /&gt;
* [[HTTP Support/en|HTTP Support]] - HTTP client / HTTP server&lt;br /&gt;
* [[Telnet Protocol/en|Telnet Protocol]] - client / server&lt;br /&gt;
* [[SSL Protocol/en|SSL Protocol]]&lt;br /&gt;
* [[IMAP &amp;amp; POP3 Support/en|IMAP &amp;amp; POP3 Support]]&lt;br /&gt;
* [[NFS Support/en|NFS Support]] - Network File System server emulation&lt;br /&gt;
* [[Sun RPC Support/en|Sun RPC Support]] - client &amp;amp; server&lt;br /&gt;
* [[Thrift Support/en|Thrift Support]]&lt;br /&gt;
* [[MQueue Plugin/en|MQueue Plugin]] - websphere/mainframe interface&lt;br /&gt;
* [[Serial Port Communication/en|Serial Port Communication]]&lt;br /&gt;
* [[Parallel Port Communication/en|Parallel Port Communication]]&lt;br /&gt;
* [[USB Port Communication/en|USB Port Communication]]&lt;br /&gt;
* [[ChipCard/SmartCard Package/en|ChipCard/SmartCard Package]] - GSM, EC, ISO7816 cards and other standards via GemPlus, Oros and other interfaces&lt;br /&gt;
* [[GPIB Interface/en|GPIB Interface]] - measurement device interface&lt;br /&gt;
* [[CanBUS Interface/en|CanBUS Interface]] - low level interface via serial or USB interface&lt;br /&gt;
* [[LDAP Interface/en|LDAP Interface]]&lt;br /&gt;
* [[COM Interface/en|OLE/COM Interface]]&lt;br /&gt;
* [[MQTT Support/en | MQTT Protocol]] - IoT (Internet of Things)&lt;br /&gt;
* [[SOME/IP]] - automotive&lt;br /&gt;
&lt;br /&gt;
=== Databases ===&lt;br /&gt;
* [[ODBC Interface/en|ODBC Interface]] (part of the base package)&lt;br /&gt;
* [[ODBC Interface/en|SQLite Interface]] (part of the base package)&lt;br /&gt;
* [[Oracle Native Interface/en|Oracle Native Interface]]&lt;br /&gt;
&lt;br /&gt;
==== NoSQL ====&lt;br /&gt;
* [[Cassandra Interface/en|Cassandra Interface]]&lt;br /&gt;
* [[CouchDB Interface/en|CouchDB Interface]]&lt;br /&gt;
* [[MongoDB Interface/en|MongoDB Interface]]&lt;br /&gt;
* [[SandstoneDB Interface/en|SandstoneDB Interface]]&lt;br /&gt;
* [[Goods-DB Interface/en|Goods-DB Interface]]&lt;br /&gt;
&lt;br /&gt;
=== API ===&lt;br /&gt;
* [[Plugin API/en|Plugin API]] - information for Plugin developers&lt;br /&gt;
&lt;br /&gt;
=== [[expecco Mobile Remote App/en|expecco Mobile Remote App (for Android)]] ===&lt;br /&gt;
&lt;br /&gt;
== Customization ==&lt;br /&gt;
&lt;br /&gt;
* [[User Defined Menu Items/en|User Defined Menu Items]]&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
== Concepts, Hints, Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
* [[expecco API/en|expecco API]]&lt;br /&gt;
* [[Executor/en|Executor]]&lt;br /&gt;
* [[Executor#Activity/en|Executor - Activity]]&lt;br /&gt;
&lt;br /&gt;
* [[Generating Test Data/en|Generating Test Data]]&lt;br /&gt;
* [[Parametrizing Tests/en|Parametrizing Tests]]&lt;br /&gt;
* [[Organizing Libraries/en|Organizing Libraries]]&lt;br /&gt;
* [[Reimporting a Library/en|Reimporting a Library]]&lt;br /&gt;
* [[Uses of Tags/en|Uses of Tags]]&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Testing Java Applications using Groovy blocks/en|Testing Java Applications using Groovy Blocks]]&lt;br /&gt;
&lt;br /&gt;
= expecco ALM =&lt;br /&gt;
== Overview ==&lt;br /&gt;
[[expecco ALM Architecture/en|expecco ALM (Application Lifecycle Management)]]&lt;br /&gt;
&lt;br /&gt;
=== Glossary ===&lt;br /&gt;
&lt;br /&gt;
=== Konzepte ===&lt;br /&gt;
* [[expecco ALM Architecture/en|Architecture]] - overview and architecture&lt;br /&gt;
* [[expecco ALM Concepts/en|Concepts]] - concepts; testsuite, testdefinition, testschedule, testrun, testequipment&lt;br /&gt;
* [[expecco ALM Configuration &amp;amp; Setup/en|Configuration &amp;amp; Setup]] - setting up users, roles and projects&lt;br /&gt;
&lt;br /&gt;
=== Release Notes ===&lt;br /&gt;
* [[expecco ALM Release Notes/en 1.9.5|1.9.5]]&lt;br /&gt;
* [[expecco ALM Release Notes/en 2.0.0|2.0.0]]&lt;br /&gt;
&lt;br /&gt;
== [[expecco ALM Installation/en|Installation]] ==&lt;br /&gt;
&lt;br /&gt;
== [[expecco ALM System Settings/en|Settings (System)]] ==&lt;br /&gt;
* [[expecco ALM System Settings LDAP/en|Login using LDAP]]&lt;br /&gt;
&lt;br /&gt;
== Webinterface (HTTP) ==&lt;br /&gt;
* [[expecco ALM Personal Settings/en|Personal Settings]] - editor settings&lt;br /&gt;
* [[expecco ALM Master Menu/en|Master Menu]]&lt;br /&gt;
* [[expecco ALM Requirements UI/en|Requirements UI]]&lt;br /&gt;
* [[expecco ALM Defects UI/en|Defects UI]]&lt;br /&gt;
* [[expecco ALM Actions UI/en|Actions UI]]&lt;br /&gt;
* [[expecco ALM Tests UI/en|Tests UI]]&lt;br /&gt;
* [[expecco ALM Projects UI/en|Projects UI]]&lt;br /&gt;
* [[expecco ALM Organization UI/en|Organization UI]]&lt;br /&gt;
* [[expecco ALM Settings UI/en|Settings UI]]&lt;br /&gt;
&lt;br /&gt;
== Mobile Monitoring App (Android) ==&lt;br /&gt;
* [[expecco ALM App/en|expecco ALM App]]&lt;br /&gt;
&lt;br /&gt;
= Licenseservice =&lt;br /&gt;
== General ==&lt;br /&gt;
* [[License Server Overview/en|Overview]]&lt;br /&gt;
* [[License Server Release Notes/en|Release Notes]]&lt;br /&gt;
* [[Lizenzservice Installation/en|Installation]] - initial installation, license files, updates&lt;br /&gt;
* [[License Server Configuration &amp;amp; Setup/en|Configuration &amp;amp; Setup]] - setting up ports and users&lt;br /&gt;
* [[License Server Glossary/en|Glossary]]&lt;br /&gt;
&lt;br /&gt;
== User Interface ==&lt;br /&gt;
* [[License Server License Menu/en|License Menu]]&lt;br /&gt;
&lt;br /&gt;
= Smalltalk =&lt;br /&gt;
&lt;br /&gt;
* http://live.exept.de  Online Documentation&lt;br /&gt;
* http://live.exept.de/ClassDoc  Class Documentation&lt;br /&gt;
&lt;br /&gt;
== Packages ==&lt;br /&gt;
* [[SOAP/en|SOAP]]&lt;br /&gt;
* [[SOAP WSDL/en|SOAP WSDL]]&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11284</id>
		<title>WindowsAutomation Reference 2.0</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11284"/>
		<updated>2018-05-28T15:11:06Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the documentation for the Windows Automation 2.0 plugin.&lt;br /&gt;
&lt;br /&gt;
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
*Automated GUI testing of WPF, WinForms, and Win32 applications.&lt;br /&gt;
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.&lt;br /&gt;
*Parallel remote test-execution on multiple systems.&lt;br /&gt;
*Performs tests against already built executables. No source code changes / recompilation of the application is required.&lt;br /&gt;
*Access to GUI components using XPath locators.&lt;br /&gt;
*Access objects of the application live at execution time.&lt;br /&gt;
*Full access to keyboard and mouse of the target system.&lt;br /&gt;
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...&lt;br /&gt;
&lt;br /&gt;
=Installation and Connection=&lt;br /&gt;
The WindowsAutomation testing plugin uses the expecoo &amp;quot;.NET-Bridge&amp;quot; which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
On the machine running the system under test:&lt;br /&gt;
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.&lt;br /&gt;
* One of the following operation systems:&lt;br /&gt;
::- Windows 7 SP1&lt;br /&gt;
::- Windows 8&lt;br /&gt;
::- Windows 8.1&lt;br /&gt;
::- Windows 10&lt;br /&gt;
&lt;br /&gt;
::- Windows Server 2008 R2 SP1&lt;br /&gt;
::- Windows Server 2012&lt;br /&gt;
::- Windows Server 2012 R2&lt;br /&gt;
::- Windows Server 2016&lt;br /&gt;
::- Windows Server, version 1709&lt;br /&gt;
&lt;br /&gt;
==Plugin Components==&lt;br /&gt;
The plugin consists of the following parts:&lt;br /&gt;
* The GUI Browser, used to interactively explore your application.&lt;br /&gt;
* The Windows Automation Library, which provides blocks that you can use in your test cases.&lt;br /&gt;
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.&lt;br /&gt;
&lt;br /&gt;
==Installing and Configuring the Plugin in Expecco==&lt;br /&gt;
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the &amp;quot;plugin&amp;quot; subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Preparing a local system for test execution==&lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Everything should work out of the box.&lt;br /&gt;
&lt;br /&gt;
TODO: Is that still true with the gui browser?&lt;br /&gt;
TODO: Pictures for the connection process&lt;br /&gt;
&lt;br /&gt;
==Preparing a remote system for test exeuction==&lt;br /&gt;
The remote system will have to run the &amp;quot;.Net-Bridge server&amp;quot; which in turn connects to expecco. &lt;br /&gt;
You just need to copy &amp;quot;DotNetBridgeServer.exe&amp;quot; to the computer your system under test is running on. No further installation is needed.&lt;br /&gt;
&lt;br /&gt;
To start the bridge, navigate to the executable in a shell and start it with the following arguments:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Arguments !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| -s || Yes || Tells the executable to run in server mode (as opposed to client mode).&lt;br /&gt;
|-&lt;br /&gt;
| -k || Yes || Tells the client to keep the connection open after aconnection has been terminated saving you the hassle to restart it every time a test finishes.&lt;br /&gt;
|-&lt;br /&gt;
| -a &amp;lt;ip/hostname&amp;gt;|| Yes || The IP-Address of the PC your application is running on.&lt;br /&gt;
|-&lt;br /&gt;
| -p &amp;lt;int&amp;gt; || No || The port the server should listen on (default is 34318).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
TODO: What settings does the plugin have?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GUI Browser=&lt;br /&gt;
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description also see [[Expecco GUI Tests Extension Reference|Gui Browser]].&lt;br /&gt;
&lt;br /&gt;
=Library=&lt;br /&gt;
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.&lt;br /&gt;
&lt;br /&gt;
== Connecting to an Application ==&lt;br /&gt;
To automate an application, you first have to connect to it. You can do this with the&lt;br /&gt;
blocks from the &#039;&#039;&#039;Connecting&#039;&#039;&#039; group.&lt;br /&gt;
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library&#039;s Connection Blocks.]]&lt;br /&gt;
&lt;br /&gt;
You can connect to an application by its &#039;&#039;&#039;executable name&#039;&#039;&#039;, or by its &#039;&#039;&#039;process id&#039;&#039;&#039;. &lt;br /&gt;
If you use the executable name, expecco will attach to the main process of the specified executable. Be careful as this is not necessarily the process &lt;br /&gt;
drawing the GUI! Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.&lt;br /&gt;
All connection blocks also require you to specify a &#039;&#039;&#039;name&#039;&#039;&#039; by which the connection should be known in future.&lt;br /&gt;
This is needed for when you automate multiple applications at the same time and need to change&lt;br /&gt;
&#039;&#039;&#039;connection contexts&#039;&#039;&#039; during test execution.&lt;br /&gt;
Please note that the application to connect to has to be started before the corresponding connection block is executed.&lt;br /&gt;
You can change in context of which connection a block is executed with the &#039;&#039;&#039;Set Active Connection&#039;&#039;&#039; block.&lt;br /&gt;
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Local Connection === &lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Just use the &#039;&#039;&#039;Create Local Connection&#039;&#039;&#039; with the mentioned above parameters.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Remote Connection ===&lt;br /&gt;
Make sure that the DotNet Bridge server is started as explained in [[#Preparing a remote system for test exeuction]]&lt;br /&gt;
When the bridge is running, you can connect to it with the &#039;&#039;&#039;Create Remote Connection&#039;&#039;&#039; block using the hostname and IP-Address you specified when you started the bridge.&lt;br /&gt;
&lt;br /&gt;
=== Closing a Connection ===&lt;br /&gt;
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.&lt;br /&gt;
One simple way to do this is to setup your connections in the &#039;&#039;&#039;Before Execution&#039;&#039;&#039; part of the test suite&lt;br /&gt;
and put the &#039;&#039;&#039;Close All Connections&#039;&#039;&#039; block in the &#039;&#039;&#039;After exeuction&#039;&#039;&#039; part.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Accessing GUI Elements ==&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library&#039;s GUI Element Access Blocks.]]&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksExamples.PNG|frame|A Few Examples on How to Access Elements in Notepad.]]&lt;br /&gt;
All Windows applications are built as a &#039;&#039;&#039; tree&#039;&#039;&#039;  of &#039;&#039;&#039; GUI elements&#039;&#039;&#039; .&lt;br /&gt;
Some elements act as container of other element - their children. Tables, for example, are containers&lt;br /&gt;
for their cell elements which themselves might contain text labels.&lt;br /&gt;
At the root of the tree are one or more &#039;&#039;&#039;windows&#039;&#039;&#039; . When you connect to an application, you get access to&lt;br /&gt;
all windows at the tree&#039;s root.&lt;br /&gt;
To manipulate any of the system under test&#039;s GUI element, you first have to gain access to it.&lt;br /&gt;
The group &#039;&#039;&#039;GUI Element Access&#039;&#039;&#039;  provides blocks that help you to gain access to the elements. There are 12 blocks in total, divided between &#039;&#039;&#039; Access By XPath&#039;&#039;&#039; , &#039;&#039;&#039;Access By Property&#039;&#039;&#039;,&lt;br /&gt;
and &#039;&#039;&#039;Existence Test&#039;&#039;&#039;. For each category, blocks with the same interface exist. The only difference is the method of retrival.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Element : returns a &#039;&#039;&#039;single&#039;&#039;&#039; GUI Element matching the search condition. If multiple match the condition, an &#039;&#039;&#039;arbitrary&#039;&#039;&#039; element matching the condition is returned.&lt;br /&gt;
:If you want to make sure that there is only one element matching, set &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039;  to true. You can also enforce this globally by setting the environment variable &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039; in your environment. &lt;br /&gt;
:If ensureExclusive is set and more than one element is found, the block will fail and notify you of the ambiguity. This is disabled by default as checking for uniqueness is a very costly operation.&lt;br /&gt;
:You can also specify a &#039;&#039;&#039;timeout&#039;&#039;&#039; after which the search is aborted. This is useful if you know an element should be there soon but might currently be loading.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Elements: returns &#039;&#039;&#039;all&#039;&#039;&#039; GUI Element matching the search condition. If no element is found, it returns an empty list &amp;lt;b&amp;gt; Timeout &amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;cacheXPath&amp;lt;/b&amp;gt; are also applicable.&lt;br /&gt;
&lt;br /&gt;
;Exists: Works exactly the same as &#039;&#039;&#039;Get GUI Element&#039;&#039;&#039; but does not fail if no element can be found. Additionally provides an output pin specifying if an element has been found.&lt;br /&gt;
&lt;br /&gt;
Both of these blocks are also available in the &#039;&#039;&#039;Relative To Anchor&#039;&#039;&#039; variety. Those blocks also take a GUI Element as &#039;&#039;&#039;anchor&#039;&#039;&#039; in relation to which they search. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Using XPaths ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;XPath&#039;&#039;&#039; is the query language this plugin uses for selecting GUI elements in the application&#039;s element tree.&lt;br /&gt;
You can find the XPath of an element with the [[Expecco GUI Tests Extension Reference|Gui Browser]] or with third-party applications like Inspect.exe [https://msdn.microsoft.com/en-us/library/dd318521(v=vs.85).aspx] or FlaUInspect [https://github.com/FlauTech/FlaUInspect].&lt;br /&gt;
An &#039;&#039;&#039;XPath&#039;&#039;&#039; for the scroll button on the &lt;br /&gt;
vertical scrollbar in the german Windows Notepad application looks like this:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;]/Document[@Name=&#039;Text-Editor&#039;]/ScrollBar[@Name=&#039;Vertikale Bildlaufleiste&#039;]/Button[@Name=&#039;Bildlauf nach unten&#039;] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each level in the GUI tree, a new &amp;lt;b&amp;gt;Location Step&amp;lt;/b&amp;gt; containing the child elements &amp;lt;b&amp;gt;Control Type&amp;lt;/b&amp;gt; has to be added.&lt;br /&gt;
You do not have to use any predicates, the following XPath is valid as well:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window/Document/ScrollBar/Button &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but might lead to issues as there might be multiple GUI Elements matching this path.&lt;br /&gt;
You can select by three predicates that can be mixed and matched in the same query:&lt;br /&gt;
&lt;br /&gt;
; Name: the name the application developer has given an element. Be careful as this name might change during programm execution (See for example Notepad&#039;s window name which always begins with the name of the currently opened file.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
; AutomationId: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced.&lt;br /&gt;
: Many developersleave the ID empty or reuse it, making it useless. You should nontheless use this ID wherever applicable as it is static&lt;br /&gt;
: and meant for this exact purpose.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;List Index: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[last()] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Using Wildcards in XPaths ===&lt;br /&gt;
&lt;br /&gt;
XPath also supports &#039;&#039;&#039;wildcards&#039;&#039;&#039;. You can:&lt;br /&gt;
* replace &#039;&#039;&#039;one tree level&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard: &lt;br /&gt;
&amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;]/*/Button[1]&amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/*/*/*/Button[1] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace a &#039;&#039;&#039;control type&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;/Window/*[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace &#039;&#039;&#039;an arbitrary amount of tree levels&#039;&#039;&#039; with a &amp;quot;//&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;//Button &amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/Window//Button[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Especially the last option is useful as it makes your tests &amp;lt;b&amp;gt;more readable&amp;lt;/b&amp;gt; as the reader can easily focus on the relevant parts of the xpath.&lt;br /&gt;
But be careful. Using wildcards comes at a steep &amp;lt;b&amp;gt;performance cost&amp;lt;/b&amp;gt;. If your tests run unacceptably slow, first try to &#039;&#039;&#039;remove wildcards where they are not needed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Using Properties===&lt;br /&gt;
&lt;br /&gt;
You can also search for elements by property by specifying a value an element&#039;s property with the given name must have. For a list of properties a GUI element might have, take a look at Microsoft&#039;s documentation [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]. It specifies the supported properties for each pattern an element can support.&lt;br /&gt;
&lt;br /&gt;
=== XPath Resolution in Action Blocks ===&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksModes.PNG|frame|Different Ways to Reference a GUI Element.]]&lt;br /&gt;
Getting a reference to the GUI Element everytime you need to manipulate it in any way can make for very unclean looking test suites as two blocks are needed to perform any action - one for getting a reference to the element and another one for perform the action. The library therefore also allows you to directly feed an xpath into every block that would take a reference to a GUI Element.&lt;br /&gt;
&lt;br /&gt;
The image on the right shows this mode in action. Variants 1 and 2 are functionally equivalent.&lt;br /&gt;
While Variant 2 is more concise, Variant 1 is the right choice in most cases. While it has an additional block, you have control over the other input parameters. &lt;br /&gt;
You also can recycle the GUI element reference as seen in 3). This is invaluable as the XPath only has to be resolved once. This speeds up test execution by a lot as XPath resolution is very expensive operation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rule of thumb&#039;&#039;&#039;: Always use Variant 1 except if you need the reference to the GUI element not more than once during test execution.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Manipulating GUI Elements ==&lt;br /&gt;
&lt;br /&gt;
== Checking the State of GUI Elements ==&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11273</id>
		<title>WindowsAutomation Reference 2.0</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11273"/>
		<updated>2018-05-28T14:53:54Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the documentation for the Windows Automation 2.0 plugin.&lt;br /&gt;
&lt;br /&gt;
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
*Automated GUI testing of WPF, WinForms, and Win32 applications.&lt;br /&gt;
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.&lt;br /&gt;
*Parallel remote test-execution on multiple systems.&lt;br /&gt;
*Performs tests against already built executables. No source code changes / recompilation of the application is required.&lt;br /&gt;
*Access to GUI components using XPath locators.&lt;br /&gt;
*Access objects of the application live at execution time.&lt;br /&gt;
*Full access to keyboard and mouse of the target system.&lt;br /&gt;
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...&lt;br /&gt;
&lt;br /&gt;
=Installation and Connection=&lt;br /&gt;
The WindowsAutomation testing plugin uses the expecoo &amp;quot;.NET-Bridge&amp;quot; which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
On the machine running the system under test:&lt;br /&gt;
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.&lt;br /&gt;
* One of the following operation systems:&lt;br /&gt;
::- Windows 7 SP1&lt;br /&gt;
::- Windows 8&lt;br /&gt;
::- Windows 8.1&lt;br /&gt;
::- Windows 10&lt;br /&gt;
&lt;br /&gt;
::- Windows Server 2008 R2 SP1&lt;br /&gt;
::- Windows Server 2012&lt;br /&gt;
::- Windows Server 2012 R2&lt;br /&gt;
::- Windows Server 2016&lt;br /&gt;
::- Windows Server, version 1709&lt;br /&gt;
&lt;br /&gt;
==Plugin Components==&lt;br /&gt;
The plugin consists of the following parts:&lt;br /&gt;
* The GUI Browser, used to interactively explore your application.&lt;br /&gt;
* The Windows Automation Library, which provides blocks that you can use in your test cases.&lt;br /&gt;
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.&lt;br /&gt;
&lt;br /&gt;
==Installing and Configuring the Plugin in Expecco==&lt;br /&gt;
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the &amp;quot;plugin&amp;quot; subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Preparing a local system for test execution==&lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Everything should work out of the box.&lt;br /&gt;
&lt;br /&gt;
TODO: Is that still true with the gui browser?&lt;br /&gt;
TODO: Pictures for the connection process&lt;br /&gt;
&lt;br /&gt;
==Preparing a remote system for test exeuction==&lt;br /&gt;
The remote system will have to run the &amp;quot;.Net-Bridge server&amp;quot; which in turn connects to expecco. &lt;br /&gt;
You just need to copy &amp;quot;DotNetBridgeServer.exe&amp;quot; to the computer your system under test is running on. No further installation is needed.&lt;br /&gt;
&lt;br /&gt;
To start the bridge, navigate to the executable in a shell and start it with the following arguments:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Arguments !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| -s || Yes || Tells the executable to run in server mode (as opposed to client mode).&lt;br /&gt;
|-&lt;br /&gt;
| -k || Yes || Tells the client to keep the connection open after aconnection has been terminated saving you the hassle to restart it every time a test finishes.&lt;br /&gt;
|-&lt;br /&gt;
| -a &amp;lt;ip/hostname&amp;gt;|| Yes || The IP-Address of the PC your application is running on.&lt;br /&gt;
|-&lt;br /&gt;
| -p &amp;lt;int&amp;gt; || No || The port the server should listen on (default is 34318).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
TODO: What settings does the plugin have?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GUI Browser=&lt;br /&gt;
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description also see [[Expecco GUI Tests Extension Reference|Gui Browser]].&lt;br /&gt;
&lt;br /&gt;
=Library=&lt;br /&gt;
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.&lt;br /&gt;
&lt;br /&gt;
== Connecting to an Application ==&lt;br /&gt;
To automate an application, you first have to connect to it. You can do this with the&lt;br /&gt;
blocks from the &#039;&#039;&#039;Connecting&#039;&#039;&#039; group.&lt;br /&gt;
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library&#039;s Connection Blocks.]]&lt;br /&gt;
&lt;br /&gt;
You can connect to an application by its &#039;&#039;&#039;executable name&#039;&#039;&#039;, or by its &#039;&#039;&#039;process id&#039;&#039;&#039;. &lt;br /&gt;
If you use the executable name, expecco will attach to the main process of the specified executable. Be careful as this is not necessarily the process &lt;br /&gt;
drawing the GUI! Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.&lt;br /&gt;
All connection blocks also require you to specify a &#039;&#039;&#039;name&#039;&#039;&#039; by which the connection should be known in future.&lt;br /&gt;
This is needed for when you automate multiple applications at the same time and need to change&lt;br /&gt;
&#039;&#039;&#039;connection contexts&#039;&#039;&#039; during test execution.&lt;br /&gt;
Please note that the application to connect to has to be started before the corresponding connection block is executed.&lt;br /&gt;
You can change in context of which connection a block is executed with the &#039;&#039;&#039;Set Active Connection&#039;&#039;&#039; block.&lt;br /&gt;
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Local Connection === &lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Just use the &#039;&#039;&#039;Create Local Connection&#039;&#039;&#039; with the mentioned above parameters.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Remote Connection ===&lt;br /&gt;
Make sure that the DotNet Bridge server is started as explained in [[#Preparing a remote system for test exeuction]]&lt;br /&gt;
When the bridge is running, you can connect to it with the &#039;&#039;&#039;Create Remote Connection&#039;&#039;&#039; block using the hostname and IP-Address you specified when you started the bridge.&lt;br /&gt;
&lt;br /&gt;
=== Closing a Connection ===&lt;br /&gt;
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.&lt;br /&gt;
One simple way to do this is to setup your connections in the &#039;&#039;&#039;Before Execution&#039;&#039;&#039; part of the test suite&lt;br /&gt;
and put the &#039;&#039;&#039;Close All Connections&#039;&#039;&#039; block in the &#039;&#039;&#039;After exeuction&#039;&#039;&#039; part.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Accessing GUI Elements ==&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library&#039;s GUI Element Access Blocks.]]&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksExamples.PNG|frame|A Few Examples on How to Access Elements in Notepad.]]&lt;br /&gt;
All Windows applications are built as a &#039;&#039;&#039; tree&#039;&#039;&#039;  of &#039;&#039;&#039; GUI elements&#039;&#039;&#039; .&lt;br /&gt;
Some elements act as container of other element - their children. Tables, for example, are containers&lt;br /&gt;
for their cell elements which themselves might contain text labels.&lt;br /&gt;
At the root of the tree are one or more &#039;&#039;&#039;windows&#039;&#039;&#039; . When you connect to an application, you get access to&lt;br /&gt;
all windows at the tree&#039;s root.&lt;br /&gt;
To manipulate any of the system under test&#039;s GUI element, you first have to gain access to it.&lt;br /&gt;
The group &#039;&#039;&#039;GUI Element Access&#039;&#039;&#039;  provides blocks that help you to gain access to the elements. There are 12 blocks in total, divided between &#039;&#039;&#039; Access By XPath&#039;&#039;&#039; , &#039;&#039;&#039;Access By Property&#039;&#039;&#039;,&lt;br /&gt;
and &#039;&#039;&#039;Existence Test&#039;&#039;&#039;. For each category, blocks with the same interface exist. The only difference is the method of retrival.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Element : returns a &#039;&#039;&#039;single&#039;&#039;&#039; GUI Element matching the search condition. If multiple match the condition, an &#039;&#039;&#039;arbitrary&#039;&#039;&#039; element matching the condition is returned.&lt;br /&gt;
:If you want to make sure that there is only one element matching, set &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039;  to true. You can also enforce this globally by setting the environment variable &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039; in your environment. &lt;br /&gt;
:If ensureExclusive is set and more than one element is found, the block will fail and notify you of the ambiguity. This is disabled by default as checking for uniqueness is a very costly operation.&lt;br /&gt;
:You can also specify a &#039;&#039;&#039;timeout&#039;&#039;&#039; after which the search is aborted. This is useful if you know an element should be there soon but might currently be loading.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Elements: returns &#039;&#039;&#039;all&#039;&#039;&#039; GUI Element matching the search condition. If no element is found, it returns an empty list &amp;lt;b&amp;gt; Timeout &amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;cacheXPath&amp;lt;/b&amp;gt; are also applicable.&lt;br /&gt;
&lt;br /&gt;
;Exists: Works exactly the same as &#039;&#039;&#039;Get GUI Element&#039;&#039;&#039; but does not fail if no element can be found. Additionally provides an output pin specifying if an element has been found.&lt;br /&gt;
&lt;br /&gt;
Both of these blocks are also available in the &#039;&#039;&#039;Relative To Anchor&#039;&#039;&#039; variety. Those blocks also take a GUI Element as &#039;&#039;&#039;anchor&#039;&#039;&#039; in relation to which they search. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Using XPaths ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;XPath&#039;&#039;&#039; is the query language this plugin uses for selecting GUI elements in the application&#039;s element tree.&lt;br /&gt;
You can find the XPath of an element with the [[Expecco GUI Tests Extension Reference|Gui Browser]] or with third-party applications like Inspect.exe [https://msdn.microsoft.com/en-us/library/dd318521(v=vs.85).aspx] or FlaUInspect [https://github.com/FlauTech/FlaUInspect].&lt;br /&gt;
An &#039;&#039;&#039;XPath&#039;&#039;&#039; for the scroll button on the &lt;br /&gt;
vertical scrollbar in the german Windows Notepad application looks like this:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;]/Document[@Name=&#039;Text-Editor&#039;]/ScrollBar[@Name=&#039;Vertikale Bildlaufleiste&#039;]/Button[@Name=&#039;Bildlauf nach unten&#039;] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each level in the GUI tree, a new &amp;lt;b&amp;gt;Location Step&amp;lt;/b&amp;gt; containing the child elements &amp;lt;b&amp;gt;Control Type&amp;lt;/b&amp;gt; has to be added.&lt;br /&gt;
You do not have to use any predicates, the following XPath is valid as well:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window/Document/ScrollBar/Button &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but might lead to issues as there might be multiple GUI Elements matching this path.&lt;br /&gt;
You can select by three predicates that can be mixed and matched in the same query:&lt;br /&gt;
&lt;br /&gt;
; Name: the name the application developer has given an element. Be careful as this name might change during programm execution (See for example Notepad&#039;s window name which always begins with the name of the currently opened file.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
; AutomationId: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced.&lt;br /&gt;
: Many developersleave the ID empty or reuse it, making it useless. You should nontheless use this ID wherever applicable as it is static&lt;br /&gt;
: and meant for this exact purpose.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;List Index: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[last()] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Using Wildcards in XPaths ===&lt;br /&gt;
&lt;br /&gt;
XPath also supports &#039;&#039;&#039;wildcards&#039;&#039;&#039;. You can:&lt;br /&gt;
* replace &#039;&#039;&#039;one tree level&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard: &lt;br /&gt;
&amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;]/*/Button[1]&amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/*/*/*/Button[1] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace a &#039;&#039;&#039;control type&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;/Window/*[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace &#039;&#039;&#039;an arbitrary amount of tree levels&#039;&#039;&#039; with a &amp;quot;//&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;//Button &amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/Window//Button[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Especially the last option is useful as it makes your tests &amp;lt;b&amp;gt;more readable&amp;lt;/b&amp;gt; as the reader can easily focus on the relevant parts of the xpath.&lt;br /&gt;
But be careful. Using wildcards comes at a steep &amp;lt;b&amp;gt;performance cost&amp;lt;/b&amp;gt;. If your tests run unacceptably slow, first try to &#039;&#039;&#039;remove wildcards where they are not needed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Using Properties===&lt;br /&gt;
&lt;br /&gt;
You can also search for elements by property by specifying a value an element&#039;s property with the given name must have. For a list of properties a GUI element might have, take a look at Microsoft&#039;s documentation [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]. It specifies the supported properties for each pattern an element can support.&lt;br /&gt;
&lt;br /&gt;
=== XPath resolution in action blocks ===&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksModes.PNG|frame|Different Ways to Reference a GUI Element.]]&lt;br /&gt;
Getting a reference to the GUI Element everytime you need to manipulate it in any way can make for very unclean looking test suites as two blocks are needed to perform any action - one for getting a reference to the element and another one for perform the action. The library therefore also allows you to directly feed an xpath into every block that would take a reference to a GUI Element.&lt;br /&gt;
The image on the right shows this mode in action. Variants 1 and 2 are functionally equivalent.&lt;br /&gt;
While Variant 2 is more concise, Variant 1 is the right choice in most cases.&lt;br /&gt;
&lt;br /&gt;
== Manipulating GUI Elements ==&lt;br /&gt;
&lt;br /&gt;
== Checking the State of GUI Elements ==&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_AccessBlocksModes.PNG&amp;diff=11272</id>
		<title>Datei:WindowsAutomation Library AccessBlocksModes.PNG</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_AccessBlocksModes.PNG&amp;diff=11272"/>
		<updated>2018-05-28T14:49:59Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_AccessBlocksExamples.PNG&amp;diff=11271</id>
		<title>Datei:WindowsAutomation Library AccessBlocksExamples.PNG</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_AccessBlocksExamples.PNG&amp;diff=11271"/>
		<updated>2018-05-28T14:31:11Z</updated>

		<summary type="html">&lt;p&gt;Lv: Lv lud eine neue Version von „Datei:WindowsAutomation Library AccessBlocksExamples.PNG“ hoch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11270</id>
		<title>WindowsAutomation Reference 2.0</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11270"/>
		<updated>2018-05-28T14:30:27Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the documentation for the Windows Automation 2.0 plugin.&lt;br /&gt;
&lt;br /&gt;
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
*Automated GUI testing of WPF, WinForms, and Win32 applications.&lt;br /&gt;
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.&lt;br /&gt;
*Parallel remote test-execution on multiple systems.&lt;br /&gt;
*Performs tests against already built executables. No source code changes / recompilation of the application is required.&lt;br /&gt;
*Access to GUI components using XPath locators.&lt;br /&gt;
*Access objects of the application live at execution time.&lt;br /&gt;
*Full access to keyboard and mouse of the target system.&lt;br /&gt;
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...&lt;br /&gt;
&lt;br /&gt;
=Installation and Connection=&lt;br /&gt;
The WindowsAutomation testing plugin uses the expecoo &amp;quot;.NET-Bridge&amp;quot; which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
On the machine running the system under test:&lt;br /&gt;
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.&lt;br /&gt;
* One of the following operation systems:&lt;br /&gt;
::- Windows 7 SP1&lt;br /&gt;
::- Windows 8&lt;br /&gt;
::- Windows 8.1&lt;br /&gt;
::- Windows 10&lt;br /&gt;
&lt;br /&gt;
::- Windows Server 2008 R2 SP1&lt;br /&gt;
::- Windows Server 2012&lt;br /&gt;
::- Windows Server 2012 R2&lt;br /&gt;
::- Windows Server 2016&lt;br /&gt;
::- Windows Server, version 1709&lt;br /&gt;
&lt;br /&gt;
==Plugin Components==&lt;br /&gt;
The plugin consists of the following parts:&lt;br /&gt;
* The GUI Browser, used to interactively explore your application.&lt;br /&gt;
* The Windows Automation Library, which provides blocks that you can use in your test cases.&lt;br /&gt;
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.&lt;br /&gt;
&lt;br /&gt;
==Installing and Configuring the Plugin in Expecco==&lt;br /&gt;
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the &amp;quot;plugin&amp;quot; subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Preparing a local system for test execution==&lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Everything should work out of the box.&lt;br /&gt;
&lt;br /&gt;
TODO: Is that still true with the gui browser?&lt;br /&gt;
TODO: Pictures for the connection process&lt;br /&gt;
&lt;br /&gt;
==Preparing a remote system for test exeuction==&lt;br /&gt;
The remote system will have to run the &amp;quot;.Net-Bridge server&amp;quot; which in turn connects to expecco. &lt;br /&gt;
You just need to copy &amp;quot;DotNetBridgeServer.exe&amp;quot; to the computer your system under test is running on. No further installation is needed.&lt;br /&gt;
&lt;br /&gt;
To start the bridge, navigate to the executable in a shell and start it with the following arguments:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Arguments !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| -s || Yes || Tells the executable to run in server mode (as opposed to client mode).&lt;br /&gt;
|-&lt;br /&gt;
| -k || Yes || Tells the client to keep the connection open after aconnection has been terminated saving you the hassle to restart it every time a test finishes.&lt;br /&gt;
|-&lt;br /&gt;
| -a &amp;lt;ip/hostname&amp;gt;|| Yes || The IP-Address of the PC your application is running on.&lt;br /&gt;
|-&lt;br /&gt;
| -p &amp;lt;int&amp;gt; || No || The port the server should listen on (default is 34318).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
TODO: What settings does the plugin have?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GUI Browser=&lt;br /&gt;
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description also see [[Expecco GUI Tests Extension Reference|Gui Browser]].&lt;br /&gt;
&lt;br /&gt;
=Library=&lt;br /&gt;
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.&lt;br /&gt;
&lt;br /&gt;
== Connecting to an Application ==&lt;br /&gt;
To automate an application, you first have to connect to it. You can do this with the&lt;br /&gt;
blocks from the &#039;&#039;&#039;Connecting&#039;&#039;&#039; group.&lt;br /&gt;
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library&#039;s Connection Blocks.]]&lt;br /&gt;
&lt;br /&gt;
You can connect to an application by its &#039;&#039;&#039;executable name&#039;&#039;&#039;, or by its &#039;&#039;&#039;process id&#039;&#039;&#039;. &lt;br /&gt;
If you use the executable name, expecco will attach to the main process of the specified executable. Be careful as this is not necessarily the process &lt;br /&gt;
drawing the GUI! Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.&lt;br /&gt;
All connection blocks also require you to specify a &#039;&#039;&#039;name&#039;&#039;&#039; by which the connection should be known in future.&lt;br /&gt;
This is needed for when you automate multiple applications at the same time and need to change&lt;br /&gt;
&#039;&#039;&#039;connection contexts&#039;&#039;&#039; during test execution.&lt;br /&gt;
Please note that the application to connect to has to be started before the corresponding connection block is executed.&lt;br /&gt;
You can change in context of which connection a block is executed with the &#039;&#039;&#039;Set Active Connection&#039;&#039;&#039; block.&lt;br /&gt;
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Local Connection === &lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Just use the &#039;&#039;&#039;Create Local Connection&#039;&#039;&#039; with the mentioned above parameters.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Remote Connection ===&lt;br /&gt;
Make sure that the DotNet Bridge server is started as explained in [[#Preparing a remote system for test exeuction]]&lt;br /&gt;
When the bridge is running, you can connect to it with the &#039;&#039;&#039;Create Remote Connection&#039;&#039;&#039; block using the hostname and IP-Address you specified when you started the bridge.&lt;br /&gt;
&lt;br /&gt;
=== Closing a Connection ===&lt;br /&gt;
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.&lt;br /&gt;
One simple way to do this is to setup your connections in the &#039;&#039;&#039;Before Execution&#039;&#039;&#039; part of the test suite&lt;br /&gt;
and put the &#039;&#039;&#039;Close All Connections&#039;&#039;&#039; block in the &#039;&#039;&#039;After exeuction&#039;&#039;&#039; part.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Accessing GUI Elements ==&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library&#039;s GUI Element Access Blocks.]]&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocksExamples.PNG|frame|A Few Examples on How to Access Elements in Notepad.]]&lt;br /&gt;
All Windows applications are built as a &#039;&#039;&#039; tree&#039;&#039;&#039;  of &#039;&#039;&#039; GUI elements&#039;&#039;&#039; .&lt;br /&gt;
Some elements act as container of other element - their children. Tables, for example, are containers&lt;br /&gt;
for their cell elements which themselves might contain text labels.&lt;br /&gt;
At the root of the tree are one or more &#039;&#039;&#039;windows&#039;&#039;&#039; . When you connect to an application, you get access to&lt;br /&gt;
all windows at the tree&#039;s root.&lt;br /&gt;
To manipulate any of the system under test&#039;s GUI element, you first have to gain access to it.&lt;br /&gt;
The group &#039;&#039;&#039;GUI Element Access&#039;&#039;&#039;  provides blocks that help you to gain access to the elements. There are 12 blocks in total, divided between &#039;&#039;&#039; Access By XPath&#039;&#039;&#039; , &#039;&#039;&#039;Access By Property&#039;&#039;&#039;,&lt;br /&gt;
and &#039;&#039;&#039;Existence Test&#039;&#039;&#039;. For each category, blocks with the same interface exist. The only difference is the method of retrival.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Element : returns a &#039;&#039;&#039;single&#039;&#039;&#039; GUI Element matching the search condition. If multiple match the condition, an &#039;&#039;&#039;arbitrary&#039;&#039;&#039; element matching the condition is returned.&lt;br /&gt;
:If you want to make sure that there is only one element matching, set &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039;  to true. You can also enforce this globally by setting the environment variable &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039; in your environment. &lt;br /&gt;
:If ensureExclusive is set and more than one element is found, the block will fail and notify you of the ambiguity. This is disabled by default as checking for uniqueness is a very costly operation.&lt;br /&gt;
:You can also specify a &#039;&#039;&#039;timeout&#039;&#039;&#039; after which the search is aborted. This is useful if you know an element should be there soon but might currently be loading.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Elements: returns &#039;&#039;&#039;all&#039;&#039;&#039; GUI Element matching the search condition. If no element is found, it returns an empty list &amp;lt;b&amp;gt; Timeout &amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;cacheXPath&amp;lt;/b&amp;gt; are also applicable.&lt;br /&gt;
&lt;br /&gt;
;Exists: Works exactly the same as &#039;&#039;&#039;Get GUI Element&#039;&#039;&#039; but does not fail if no element can be found. Additionally provides an output pin specifying if an element has been found.&lt;br /&gt;
&lt;br /&gt;
Both of these blocks are also available in the &#039;&#039;&#039;Relative To Anchor&#039;&#039;&#039; variety. Those blocks also take a GUI Element as &#039;&#039;&#039;anchor&#039;&#039;&#039; in relation to which they search. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Using XPaths ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;XPath&#039;&#039;&#039; is the query language this plugin uses for selecting GUI elements in the application&#039;s element tree.&lt;br /&gt;
You can find the XPath of an element with the [[Expecco GUI Tests Extension Reference|Gui Browser]] or with third-party applications like Inspect.exe [https://msdn.microsoft.com/en-us/library/dd318521(v=vs.85).aspx] or FlaUInspect [https://github.com/FlauTech/FlaUInspect].&lt;br /&gt;
An &#039;&#039;&#039;XPath&#039;&#039;&#039; for the scroll button on the &lt;br /&gt;
vertical scrollbar in the german Windows Notepad application looks like this:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;]/Document[@Name=&#039;Text-Editor&#039;]/ScrollBar[@Name=&#039;Vertikale Bildlaufleiste&#039;]/Button[@Name=&#039;Bildlauf nach unten&#039;] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each level in the GUI tree, a new &amp;lt;b&amp;gt;Location Step&amp;lt;/b&amp;gt; containing the child elements &amp;lt;b&amp;gt;Control Type&amp;lt;/b&amp;gt; has to be added.&lt;br /&gt;
You do not have to use any predicates, the following XPath is valid as well:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window/Document/ScrollBar/Button &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but might lead to issues as there might be multiple GUI Elements matching this path.&lt;br /&gt;
You can select by three predicates that can be mixed and matched in the same query:&lt;br /&gt;
&lt;br /&gt;
; Name: the name the application developer has given an element. Be careful as this name might change during programm execution (See for example Notepad&#039;s window name which always begins with the name of the currently opened file.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
; AutomationId: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced.&lt;br /&gt;
: Many developersleave the ID empty or reuse it, making it useless. You should nontheless use this ID wherever applicable as it is static&lt;br /&gt;
: and meant for this exact purpose.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;List Index: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[last()] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Using Wildcards in XPaths ===&lt;br /&gt;
&lt;br /&gt;
XPath also supports &#039;&#039;&#039;wildcards&#039;&#039;&#039;. You can:&lt;br /&gt;
* replace &#039;&#039;&#039;one tree level&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard: &lt;br /&gt;
&amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;]/*/Button[1]&amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/*/*/*/Button[1] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace a &#039;&#039;&#039;control type&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;/Window/*[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace &#039;&#039;&#039;an arbitrary amount of tree levels&#039;&#039;&#039; with a &amp;quot;//&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;//Button &amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/Window//Button[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Especially the last option is useful as it makes your tests &amp;lt;b&amp;gt;more readable&amp;lt;/b&amp;gt; as the reader can easily focus on the relevant parts of the xpath.&lt;br /&gt;
But be careful. Using wildcards comes at a steep &amp;lt;b&amp;gt;performance cost&amp;lt;/b&amp;gt;. If your tests run unacceptably slow, first try to &#039;&#039;&#039;remove wildcards where they are not needed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Using Properties===&lt;br /&gt;
&lt;br /&gt;
You can also search for elements by property by specifying a value an element&#039;s property with the given name must have. For a list of properties a GUI element might have, take a look at Microsoft&#039;s documentation [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]. It specifies the supported properties for each pattern an element can support.&lt;br /&gt;
&lt;br /&gt;
=== XPath resultion in action blocks ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;h1&amp;gt;&lt;br /&gt;
        Manipulating Gui Elements &lt;br /&gt;
        &amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;h1&amp;gt;&lt;br /&gt;
        Checking the State of Gui Elements &lt;br /&gt;
        &amp;lt;/h1&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_AccessBlocksExamples.PNG&amp;diff=11269</id>
		<title>Datei:WindowsAutomation Library AccessBlocksExamples.PNG</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_AccessBlocksExamples.PNG&amp;diff=11269"/>
		<updated>2018-05-28T14:30:18Z</updated>

		<summary type="html">&lt;p&gt;Lv: Lv lud eine neue Version von „Datei:WindowsAutomation Library AccessBlocksExamples.PNG“ hoch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_AccessBlocksExamples.PNG&amp;diff=11268</id>
		<title>Datei:WindowsAutomation Library AccessBlocksExamples.PNG</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_AccessBlocksExamples.PNG&amp;diff=11268"/>
		<updated>2018-05-28T14:25:29Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11267</id>
		<title>WindowsAutomation Reference 2.0</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11267"/>
		<updated>2018-05-28T13:34:35Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the documentation for the Windows Automation 2.0 plugin.&lt;br /&gt;
&lt;br /&gt;
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
*Automated GUI testing of WPF, WinForms, and Win32 applications.&lt;br /&gt;
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.&lt;br /&gt;
*Parallel remote test-execution on multiple systems.&lt;br /&gt;
*Performs tests against already built executables. No source code changes / recompilation of the application is required.&lt;br /&gt;
*Access to GUI components using XPath locators.&lt;br /&gt;
*Access objects of the application live at execution time.&lt;br /&gt;
*Full access to keyboard and mouse of the target system.&lt;br /&gt;
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...&lt;br /&gt;
&lt;br /&gt;
=Installation and Connection=&lt;br /&gt;
The WindowsAutomation testing plugin uses the expecoo &amp;quot;.NET-Bridge&amp;quot; which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
On the machine running the system under test:&lt;br /&gt;
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.&lt;br /&gt;
* One of the following operation systems:&lt;br /&gt;
::- Windows 7 SP1&lt;br /&gt;
::- Windows 8&lt;br /&gt;
::- Windows 8.1&lt;br /&gt;
::- Windows 10&lt;br /&gt;
&lt;br /&gt;
::- Windows Server 2008 R2 SP1&lt;br /&gt;
::- Windows Server 2012&lt;br /&gt;
::- Windows Server 2012 R2&lt;br /&gt;
::- Windows Server 2016&lt;br /&gt;
::- Windows Server, version 1709&lt;br /&gt;
&lt;br /&gt;
==Plugin Components==&lt;br /&gt;
The plugin consists of the following parts:&lt;br /&gt;
* The GUI Browser, used to interactively explore your application.&lt;br /&gt;
* The Windows Automation Library, which provides blocks that you can use in your test cases.&lt;br /&gt;
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.&lt;br /&gt;
&lt;br /&gt;
==Installing and Configuring the Plugin in Expecco==&lt;br /&gt;
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the &amp;quot;plugin&amp;quot; subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Preparing a local system for test execution==&lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Everything should work out of the box.&lt;br /&gt;
&lt;br /&gt;
TODO: Is that still true with the gui browser?&lt;br /&gt;
TODO: Pictures for the connection process&lt;br /&gt;
&lt;br /&gt;
==Preparing a remote system for test exeuction==&lt;br /&gt;
The remote system will have to run the &amp;quot;.Net-Bridge server&amp;quot; which in turn connects to expecco. &lt;br /&gt;
You just need to copy &amp;quot;DotNetBridgeServer.exe&amp;quot; to the computer your system under test is running on. No further installation is needed.&lt;br /&gt;
&lt;br /&gt;
To start the bridge, navigate to the executable in a shell and start it with the following arguments:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Arguments !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| -s || Yes || Tells the executable to run in server mode (as opposed to client mode).&lt;br /&gt;
|-&lt;br /&gt;
| -k || Yes || Tells the client to keep the connection open after aconnection has been terminated saving you the hassle to restart it every time a test finishes.&lt;br /&gt;
|-&lt;br /&gt;
| -a &amp;lt;ip/hostname&amp;gt;|| Yes || The IP-Address of the PC your application is running on.&lt;br /&gt;
|-&lt;br /&gt;
| -p &amp;lt;int&amp;gt; || No || The port the server should listen on (default is 34318).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
TODO: What settings does the plugin have?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GUI Browser=&lt;br /&gt;
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description also see [[Expecco GUI Tests Extension Reference|Gui Browser]].&lt;br /&gt;
&lt;br /&gt;
=Library=&lt;br /&gt;
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.&lt;br /&gt;
&lt;br /&gt;
== Connecting to an Application ==&lt;br /&gt;
To automate an application, you first have to connect to it. You can do this with the&lt;br /&gt;
blocks from the &#039;&#039;&#039;Connecting&#039;&#039;&#039; group.&lt;br /&gt;
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library&#039;s Connection Blocks.]]&lt;br /&gt;
&lt;br /&gt;
You can connect to an application by its &#039;&#039;&#039;executable name&#039;&#039;&#039;, or by its &#039;&#039;&#039;process id&#039;&#039;&#039;. &lt;br /&gt;
If you use the executable name, expecco will attach to the main process of the specified executable. Be careful as this is not necessarily the process &lt;br /&gt;
drawing the GUI! Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.&lt;br /&gt;
All connection blocks also require you to specify a &#039;&#039;&#039;name&#039;&#039;&#039; by which the connection should be known in future.&lt;br /&gt;
This is needed for when you automate multiple applications at the same time and need to change&lt;br /&gt;
&#039;&#039;&#039;connection contexts&#039;&#039;&#039; during test execution.&lt;br /&gt;
Please note that the application to connect to has to be started before the corresponding connection block is executed.&lt;br /&gt;
You can change in context of which connection a block is executed with the &#039;&#039;&#039;Set Active Connection&#039;&#039;&#039; block.&lt;br /&gt;
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Local Connection === &lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Just use the &#039;&#039;&#039;Create Local Connection&#039;&#039;&#039; with the mentioned above parameters.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Remote Connection ===&lt;br /&gt;
Make sure that the DotNet Bridge server is started as explained in [[#Preparing a remote system for test exeuction]]&lt;br /&gt;
When the bridge is running, you can connect to it with the &#039;&#039;&#039;Create Remote Connection&#039;&#039;&#039; block using the hostname and IP-Address you specified when you started the bridge.&lt;br /&gt;
&lt;br /&gt;
=== Closing a Connection ===&lt;br /&gt;
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.&lt;br /&gt;
One simple way to do this is to setup your connections in the &#039;&#039;&#039;Before Execution&#039;&#039;&#039; part of the test suite&lt;br /&gt;
and put the &#039;&#039;&#039;Close All Connections&#039;&#039;&#039; block in the &#039;&#039;&#039;After exeuction&#039;&#039;&#039; part.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
== Accessing GUI Elements ==&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library&#039;s GUI Element Access Blocks.]]&lt;br /&gt;
All Windows applications are built as a &#039;&#039;&#039; tree&#039;&#039;&#039;  of &#039;&#039;&#039; GUI elements&#039;&#039;&#039; .&lt;br /&gt;
Some elements act as container of other element - their children. Tables, for example, are containers&lt;br /&gt;
for their cell elements which themselves might contain text labels.&lt;br /&gt;
At the root of the tree are one or more &#039;&#039;&#039;windows&#039;&#039;&#039; . When you connect to an application, you get access to&lt;br /&gt;
all windows at the tree&#039;s root.&lt;br /&gt;
To manipulate any of the system under test&#039;s GUI element, you first have to gain access to it.&lt;br /&gt;
The group &#039;&#039;&#039;GUI Element Access&#039;&#039;&#039;  provides blocks that help you to gain access to the elements. There are 12 blocks in total, divided between &#039;&#039;&#039; Access By XPath&#039;&#039;&#039; , &#039;&#039;&#039;Access By Property&#039;&#039;&#039;,&lt;br /&gt;
and &#039;&#039;&#039;Existence Test&#039;&#039;&#039;. For each category, blocks with the same interface exist. The only difference is the method of retrival.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Element : returns a &#039;&#039;&#039;single&#039;&#039;&#039; GUI Element matching the search condition. If multiple match the condition, an &#039;&#039;&#039;arbitrary&#039;&#039;&#039; element matching the condition is returned.&lt;br /&gt;
:If you want to make sure that there is only one element matching, set &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039;  to true. You can also enforce this globally by setting the environment variable &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039; in your environment. &lt;br /&gt;
:If ensureExclusive is set and more than one element is found, the block will fail and notify you of the ambiguity. This is disabled by default as checking for uniqueness is a very costly operation.&lt;br /&gt;
:You can also specify a &#039;&#039;&#039;timeout&#039;&#039;&#039; after which the search is aborted. This is useful if you know an element should be there soon but might currently be loading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Get GUI Elements: returns &#039;&#039;&#039;all&#039;&#039;&#039; GUI Element matching the search condition. If no element is found, it returns an empty list &amp;lt;b&amp;gt; Timeout &amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;cacheXPath&amp;lt;/b&amp;gt; are also applicable.&lt;br /&gt;
&lt;br /&gt;
;Exists: Works exactly the same as &#039;&#039;&#039;Get GUI Element&#039;&#039;&#039; but does not fail if no element can be found. Additionally provides an output pin specifying if an element has been found.&lt;br /&gt;
&lt;br /&gt;
Both of these blocks are also available in the &#039;&#039;&#039;Relative To Anchor&#039;&#039;&#039; variety. Those blocks also take a GUI Element as &#039;&#039;&#039;anchor&#039;&#039;&#039; in relation to which they search. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Constructing XPaths ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;XPath&#039;&#039;&#039; is the query language this plugin uses for selecting GUI elements in the application&#039;s element tree.&lt;br /&gt;
You can find the XPath of an element with the [[Expecco GUI Tests Extension Reference|Gui Browser]] or with third-party applications like Inspect.exe [https://msdn.microsoft.com/en-us/library/dd318521(v=vs.85).aspx] or FlaUInspect [https://github.com/FlauTech/FlaUInspect].&lt;br /&gt;
An &#039;&#039;&#039;XPath&#039;&#039;&#039; for the scroll button on the &lt;br /&gt;
vertical scrollbar in the german Windows Notepad application looks like this:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;]/Document[@Name=&#039;Text-Editor&#039;]/ScrollBar[@Name=&#039;Vertikale Bildlaufleiste&#039;]/Button[@Name=&#039;Bildlauf nach unten&#039;] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each level in the GUI tree, a new &amp;lt;b&amp;gt;Location Step&amp;lt;/b&amp;gt; containing the child elements &amp;lt;b&amp;gt;Control Type&amp;lt;/b&amp;gt; has to be added.&lt;br /&gt;
You do not have to use any predicates, the following XPath is valid as well:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;/Window/Document/ScrollBar/Button &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but might lead to issues as there might be multiple GUI Elements matching this path.&lt;br /&gt;
You can select by three predicates that can be mixed and matched in the same query:&lt;br /&gt;
&lt;br /&gt;
; Name: the name the application developer has given an element. Be careful as this name might change during programm execution (See for example Notepad&#039;s window name which always begins with the name of the currently opened file.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
; AutomationId: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced.&lt;br /&gt;
: Many developersleave the ID empty or reuse it, making it useless. You should nontheless use this ID wherever applicable as it is static&lt;br /&gt;
: and meant for this exact purpose.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;List Index: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index.&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
:  &amp;lt;code&amp;gt;/Window[1]/Document[last()] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Using Wildcards in XPaths ===&lt;br /&gt;
&lt;br /&gt;
XPath also supports &#039;&#039;&#039;wildcards&#039;&#039;&#039;. You can:&lt;br /&gt;
* replace &#039;&#039;&#039;one tree level&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard: &lt;br /&gt;
&amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;]/*/Button[1]&amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/*/*/*/Button[1] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace a &#039;&#039;&#039;control type&#039;&#039;&#039; with a &amp;quot;*&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;/Window/*[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* replace &#039;&#039;&#039;an arbitrary amount of tree levels&#039;&#039;&#039; with a &amp;quot;//&amp;quot; wildcard:&lt;br /&gt;
&amp;lt;code&amp;gt;//Button &amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;/Window//Button[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Especially the last option is useful as it makes your tests &amp;lt;b&amp;gt;more readable&amp;lt;/b&amp;gt; as the reader can easily focus on the relevant parts of the xpath.&lt;br /&gt;
But be careful. Using wildcards comes at a steep &amp;lt;b&amp;gt;performance cost&amp;lt;/b&amp;gt;. If your tests run unacceptably slow, first try to &#039;&#039;&#039;remove wildcards where they are not needed&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;h2&amp;gt; Accessing by Property &amp;lt;/h2&amp;gt;&lt;br /&gt;
        &amp;lt;p&amp;gt;&lt;br /&gt;
        &amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;h2&amp;gt; XPath resultion in action blocks &amp;lt;/h2&amp;gt;&lt;br /&gt;
        &amp;lt;p&amp;gt;&lt;br /&gt;
        &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/section&amp;gt;&lt;br /&gt;
    &amp;lt;section&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;&lt;br /&gt;
        Manipulating Gui Elements &lt;br /&gt;
        &amp;lt;h1&amp;gt;&lt;br /&gt;
        &amp;lt;p&amp;gt;&lt;br /&gt;
        &amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;/section&amp;gt;&lt;br /&gt;
    &amp;lt;section&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;&lt;br /&gt;
        Checking the State of Gui Elements &lt;br /&gt;
        &amp;lt;h1&amp;gt;&lt;br /&gt;
        &amp;lt;p&amp;gt;&lt;br /&gt;
        &amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11266</id>
		<title>WindowsAutomation Reference 2.0</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11266"/>
		<updated>2018-05-28T12:51:47Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the documentation for the Windows Automation 2.0 plugin.&lt;br /&gt;
&lt;br /&gt;
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
*Automated GUI testing of WPF, WinForms, and Win32 applications.&lt;br /&gt;
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.&lt;br /&gt;
*Parallel remote test-execution on multiple systems.&lt;br /&gt;
*Performs tests against already built executables. No source code changes / recompilation of the application is required.&lt;br /&gt;
*Access to GUI components using XPath locators.&lt;br /&gt;
*Access objects of the application live at execution time.&lt;br /&gt;
*Full access to keyboard and mouse of the target system.&lt;br /&gt;
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...&lt;br /&gt;
&lt;br /&gt;
=Installation and Connection=&lt;br /&gt;
The WindowsAutomation testing plugin uses the expecoo &amp;quot;.NET-Bridge&amp;quot; which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
On the machine running the system under test:&lt;br /&gt;
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.&lt;br /&gt;
* One of the following operation systems:&lt;br /&gt;
::- Windows 7 SP1&lt;br /&gt;
::- Windows 8&lt;br /&gt;
::- Windows 8.1&lt;br /&gt;
::- Windows 10&lt;br /&gt;
&lt;br /&gt;
::- Windows Server 2008 R2 SP1&lt;br /&gt;
::- Windows Server 2012&lt;br /&gt;
::- Windows Server 2012 R2&lt;br /&gt;
::- Windows Server 2016&lt;br /&gt;
::- Windows Server, version 1709&lt;br /&gt;
&lt;br /&gt;
==Plugin Components==&lt;br /&gt;
The plugin consists of the following parts:&lt;br /&gt;
* The GUI Browser, used to interactively explore your application.&lt;br /&gt;
* The Windows Automation Library, which provides blocks that you can use in your test cases.&lt;br /&gt;
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.&lt;br /&gt;
&lt;br /&gt;
==Installing and Configuring the Plugin in Expecco==&lt;br /&gt;
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the &amp;quot;plugin&amp;quot; subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Preparing a local system for test execution==&lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Everything should work out of the box.&lt;br /&gt;
&lt;br /&gt;
TODO: Is that still true with the gui browser?&lt;br /&gt;
TODO: Pictures for the connection process&lt;br /&gt;
&lt;br /&gt;
==Preparing a remote system for test exeuction==&lt;br /&gt;
The remote system will have to run the &amp;quot;.Net-Bridge server&amp;quot; which in turn connects to expecco. &lt;br /&gt;
You just need to copy &amp;quot;DotNetBridgeServer.exe&amp;quot; to the computer your system under test is running on. No further installation is needed.&lt;br /&gt;
&lt;br /&gt;
To start the bridge, navigate to the executable in a shell and start it with the following arguments:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Arguments !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| -s || Yes || Tells the executable to run in server mode (as opposed to client mode).&lt;br /&gt;
|-&lt;br /&gt;
| -k || Yes || Tells the client to keep the connection open after aconnection has been terminated saving you the hassle to restart it every time a test finishes.&lt;br /&gt;
|-&lt;br /&gt;
| -a &amp;lt;ip/hostname&amp;gt;|| Yes || The IP-Address of the PC your application is running on.&lt;br /&gt;
|-&lt;br /&gt;
| -p &amp;lt;int&amp;gt; || No || The port the server should listen on (default is 34318).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
TODO: What settings does the plugin have?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GUI Browser=&lt;br /&gt;
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description on how to use and what to do with the GUI browser also see [[Expecco GUI Tests Extension Reference]].&lt;br /&gt;
&lt;br /&gt;
=Library=&lt;br /&gt;
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.&lt;br /&gt;
&lt;br /&gt;
== Connecting to an Application ==&lt;br /&gt;
To automate an application, you first have to connect to it. You can do this with the&lt;br /&gt;
blocks from the &#039;&#039;&#039;Connecting&#039;&#039;&#039; group.&lt;br /&gt;
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library&#039;s Connection Blocks.]]&lt;br /&gt;
&lt;br /&gt;
You can connect to an application by its &#039;&#039;&#039;executable name&#039;&#039;&#039;, or by its &#039;&#039;&#039;process id&#039;&#039;&#039;. &lt;br /&gt;
If you use the executable name, expecco will attach to the main process of the specified executable. Be careful as this is not necessarily the process &lt;br /&gt;
drawing the GUI! Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.&lt;br /&gt;
All connection blocks also require you to specify a &#039;&#039;&#039;name&#039;&#039;&#039; by which the connection should be known in future.&lt;br /&gt;
This is needed for when you automate multiple applications at the same time and need to change&lt;br /&gt;
&#039;&#039;&#039;connection contexts&#039;&#039;&#039; during test execution.&lt;br /&gt;
Please note that the application to connect to has to be started before the corresponding connection block is executed.&lt;br /&gt;
You can change in context of which connection a block is executed with the &#039;&#039;&#039;Set Active Connection&#039;&#039;&#039; block.&lt;br /&gt;
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Local Connection === &lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Just use the &#039;&#039;&#039;Create Local Connection&#039;&#039;&#039; with the mentioned above parameters.&lt;br /&gt;
&lt;br /&gt;
=== Establishing a Remote Connection ===&lt;br /&gt;
Make sure that the DotNet Bridge server is started as explained in [[#Preparing a remote system for test exeuction]]&lt;br /&gt;
When the bridge is running, you can connect to it with the &#039;&#039;&#039;Create Remote Connection&#039;&#039;&#039; block using the hostname and IP-Address you specified when you started the bridge.&lt;br /&gt;
&lt;br /&gt;
=== Closing a Connection ===&lt;br /&gt;
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.&lt;br /&gt;
One simple way to do this is to setup your connections in the &#039;&#039;&#039;Before Execution&#039;&#039;&#039; part of the test suite&lt;br /&gt;
and put the &#039;&#039;&#039;Close All Connections&#039;&#039;&#039; block in the &#039;&#039;&#039;After exeuction&#039;&#039;&#039; part.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Accessing Gui Elements ==&lt;br /&gt;
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library&#039;s GUI Element Access Blocks.]]&lt;br /&gt;
All Windows applications are built as a &#039;&#039;&#039; tree&#039;&#039;&#039;  of &#039;&#039;&#039; GUI elements&#039;&#039;&#039; .&lt;br /&gt;
Some elements act as container of other element - their children. Tables, for example, are containers&lt;br /&gt;
for their cell elements which themselves might contain text labels.&lt;br /&gt;
At the root of the tree are one or more &#039;&#039;&#039;windows&#039;&#039;&#039; . When you connect to an application, you get access to&lt;br /&gt;
all windows at the tree&#039;s root.&lt;br /&gt;
To manipulate any of the system under test&#039;s GUI element, you first have to gain access to it.&lt;br /&gt;
The group &#039;&#039;&#039;GUI Element Access&#039;&#039;&#039;  provides blocks that help you to gain access to the elements. There are 12 blocks in total, divided between &#039;&#039;&#039; Access By XPath&#039;&#039;&#039; , &#039;&#039;&#039;Access By Property&#039;&#039;&#039;,&lt;br /&gt;
and &#039;&#039;&#039;Existence Test&#039;&#039;&#039;. For each category, blocks with the same interface exist. The only difference is the method of retrival.&lt;br /&gt;
&lt;br /&gt;
;Get GUI Element : returns a &#039;&#039;&#039;single&#039;&#039;&#039; GUI Element matching the search condition. If multiple match the condition, an &#039;&#039;&#039;arbitrary&#039;&#039;&#039; element matching the condition is returned.&lt;br /&gt;
:If you want to make sure that there is only one element matching, set &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039;  to true. You can also enforce this globally by setting the environment variable &#039;&#039;&#039;ensureExclusive&#039;&#039;&#039; in your environment. &lt;br /&gt;
:If ensureExclusive is set and more than one element is found, the block will fail and notify you of the ambiguity. This is disabled by default as checking for uniqueness is a very costly operation.&lt;br /&gt;
:You can also specify a &#039;&#039;&#039;timeout&#039;&#039;&#039; after which the search is aborted. This is useful if you know an element should be there soon but might currently be loading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Get GUI Elements: returns &amp;lt;b&amp;gt;all&amp;lt;/b&amp;gt; GUI Element matching the search condition. &amp;lt;b&amp;gt; Timeout &amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;cacheXPath&amp;lt;/b&amp;gt; are also applicable.&lt;br /&gt;
&lt;br /&gt;
Both of these blocks are also available in the &#039;&#039;&#039;Relative To Anchor&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;h2&amp;gt; Constructing XPaths&amp;lt;/h2&amp;gt;&lt;br /&gt;
        &amp;lt;p&amp;gt;&lt;br /&gt;
            &amp;lt;b&amp;gt;XPath&amp;lt;/b&amp;gt; is the query language this plugin uses for selecting GUI elements in the application&#039;s element tree. &amp;lt;br /&amp;gt;&lt;br /&gt;
            You can find the XPath of an element with the &amp;lt;b&amp;gt;expecco GUI browser&amp;lt;/b&amp;gt; or with separate applications like &amp;lt;b&amp;gt;UISpy&amp;lt;/b&amp;gt; or &amp;lt;b&amp;gt;FlaUInspect&amp;lt;/b&amp;gt;. &amp;lt;br /&amp;gt;&lt;br /&gt;
            An &amp;lt;b&amp;gt;XPath&amp;lt;/b&amp;gt; for the scroll button on the &lt;br /&gt;
            vertical scrollbar in the german Windows Notepad application looks like this: &amp;lt;br /&amp;gt;&lt;br /&gt;
            &amp;lt;br /&amp;gt;&lt;br /&gt;
            &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;]/Document[@Name=&#039;Text-Editor&#039;]/ScrollBar[@Name=&#039;Vertikale Bildlaufleiste&#039;]/Button[@Name=&#039;Bildlauf nach unten&#039;] &amp;lt;/code&amp;gt;&lt;br /&gt;
            &amp;lt;br /&amp;gt;&lt;br /&gt;
            &amp;lt;br /&amp;gt;&lt;br /&gt;
            For each level in the GUI tree, a new &amp;lt;b&amp;gt;Location Step&amp;lt;/b&amp;gt; containing the child elements &amp;lt;b&amp;gt;Control Type&amp;lt;/b&amp;gt; has to be added.  &amp;lt;br /&amp;gt;&lt;br /&gt;
            You do not have to use any predicates, the following XPath is valid as well: &amp;lt;br /&amp;gt; &lt;br /&gt;
            &amp;lt;br /&amp;gt;&lt;br /&gt;
            &amp;lt;code&amp;gt;/Window/Document/ScrollBar/Button &amp;lt;/code&amp;gt;&lt;br /&gt;
            &amp;lt;br /&amp;gt;&lt;br /&gt;
            &amp;lt;br /&amp;gt;&lt;br /&gt;
            but might lead to issues as there might be multiple GUI Elements matching this path. &amp;lt;br /&amp;gt;&lt;br /&gt;
            You can select by three predicates that can be mixed and matched in the same query:&lt;br /&gt;
            &amp;lt;ul&amp;gt;&lt;br /&gt;
                &amp;lt;li&amp;gt; &lt;br /&gt;
                    &amp;lt;b&amp;gt;Name&amp;lt;/b&amp;gt;: the name the application developer has given an element. Be careful as this name might change&lt;br /&gt;
                    during programm execution (See for example Notepad&#039;s window name which always begins with the name of the currently opened file.&amp;lt;br /&amp;gt;&lt;br /&gt;
                    &amp;lt;code&amp;gt;/Window[@Name=&#039;Unbenannt - Editor&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
                &amp;lt;/li&amp;gt; &lt;br /&gt;
                &amp;lt;li&amp;gt; &lt;br /&gt;
                    &amp;lt;b&amp;gt;AutomationId&amp;lt;/b&amp;gt;: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced.&lt;br /&gt;
                    Many developers infact leave the ID empty or reuse it, making it useless. You should nontheless use this ID wherever applicable as it is static&lt;br /&gt;
                    and meant for this exact purpose. &amp;lt;br /&amp;gt;&lt;br /&gt;
                    &amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
                &amp;lt;/li&amp;gt;&lt;br /&gt;
                &amp;lt;li&amp;gt;&lt;br /&gt;
                    &amp;lt;b&amp;gt;List Index&amp;lt;/b&amp;gt;: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index. &amp;lt;br /&amp;gt;&lt;br /&gt;
                    &amp;lt;code&amp;gt;/Window[1]/Document[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
                    &amp;lt;code&amp;gt;/Window[1]/Document[last()] &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
                &amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;lt;/ul&amp;gt;&lt;br /&gt;
            XPath also supports &amp;lt;b&amp;gt;wildcards&amp;lt;/b&amp;gt;. You can:&lt;br /&gt;
            &amp;lt;ul&amp;gt;&lt;br /&gt;
                &amp;lt;li&amp;gt;&lt;br /&gt;
                    replace &amp;lt;b&amp;gt;one tree level&amp;lt;/b&amp;gt; with a &amp;quot;&amp;lt;b&amp;gt;*&amp;lt;/b&amp;gt;&amp;quot; wildcard: &amp;lt;br /&amp;gt;&lt;br /&gt;
                    &amp;lt;code&amp;gt;/Window/Document[@AutomationId=&#039;15&#039;]/*/Button[1] &amp;lt;/code&amp;gt;  &amp;lt;br /&amp;gt;&lt;br /&gt;
                    &amp;lt;code&amp;gt;/*/*/*/Button[1] &amp;lt;/code&amp;gt; &lt;br /&gt;
                &amp;lt;/li&amp;gt;&lt;br /&gt;
                &amp;lt;li&amp;gt;&lt;br /&gt;
                    replace a &amp;lt;b&amp;gt;control type&amp;lt;/b&amp;gt; with a &amp;quot;&amp;lt;b&amp;gt;*&amp;lt;/b&amp;gt;&amp;quot; wildcard: &amp;lt;br /&amp;gt;&lt;br /&gt;
                    &amp;lt;code&amp;gt;/Window/*[@AutomationId=&#039;15&#039;] &amp;lt;/code&amp;gt; &lt;br /&gt;
                &amp;lt;/li&amp;gt;&lt;br /&gt;
                &amp;lt;li&amp;gt;&lt;br /&gt;
                    replace &amp;lt;b&amp;gt;an arbitrary amount of tree levels&amp;lt;/b&amp;gt; with a &amp;quot;&amp;lt;b&amp;gt;//&amp;lt;/b&amp;gt;&amp;quot; wildcard: &amp;lt;br /&amp;gt;&lt;br /&gt;
                    &amp;lt;code&amp;gt;//Button &amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
                    &amp;lt;code&amp;gt;/Window//Button[1] &amp;lt;/code&amp;gt;&lt;br /&gt;
                &amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;lt;/ul&amp;gt;&lt;br /&gt;
            Especially the last option is useful as it makes your tests &amp;lt;b&amp;gt;more readable&amp;lt;/b&amp;gt; as the reader can easily focus on the relevant parts of the xpath. &amp;lt;br /&amp;gt;&lt;br /&gt;
            But be careful. Using wildcards comes at a steep &amp;lt;b&amp;gt;performance cost&amp;lt;/b&amp;gt;. If your tests run unacceptably slow, first try to &amp;lt;b&amp;gt;remove wildcards where they&lt;br /&gt;
            are not needed&amp;lt;/b&amp;gt;.&lt;br /&gt;
        &amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;h2&amp;gt; Accessing by Property &amp;lt;/h2&amp;gt;&lt;br /&gt;
        &amp;lt;p&amp;gt;&lt;br /&gt;
        &amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;h2&amp;gt; XPath resultion in action blocks &amp;lt;/h2&amp;gt;&lt;br /&gt;
        &amp;lt;p&amp;gt;&lt;br /&gt;
        &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/section&amp;gt;&lt;br /&gt;
    &amp;lt;section&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;&lt;br /&gt;
        Manipulating Gui Elements &lt;br /&gt;
        &amp;lt;h1&amp;gt;&lt;br /&gt;
        &amp;lt;p&amp;gt;&lt;br /&gt;
        &amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;/section&amp;gt;&lt;br /&gt;
    &amp;lt;section&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;&lt;br /&gt;
        Checking the State of Gui Elements &lt;br /&gt;
        &amp;lt;h1&amp;gt;&lt;br /&gt;
        &amp;lt;p&amp;gt;&lt;br /&gt;
        &amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=Datei:WindowsAutomation2_Library_ConnectingBlocks.PNG&amp;diff=11265</id>
		<title>Datei:WindowsAutomation2 Library ConnectingBlocks.PNG</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=Datei:WindowsAutomation2_Library_ConnectingBlocks.PNG&amp;diff=11265"/>
		<updated>2018-05-28T12:51:08Z</updated>

		<summary type="html">&lt;p&gt;Lv: Lv lud eine neue Version von „Datei:WindowsAutomation2 Library ConnectingBlocks.PNG“ hoch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Windows Automation 2 library&#039;s blocks for handling connections.&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_AccessBlocks.PNG&amp;diff=11264</id>
		<title>Datei:WindowsAutomation Library AccessBlocks.PNG</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=Datei:WindowsAutomation_Library_AccessBlocks.PNG&amp;diff=11264"/>
		<updated>2018-05-28T12:49:18Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=Datei:WindowsAutomation2_Library_ConnectingBlocks.PNG&amp;diff=11263</id>
		<title>Datei:WindowsAutomation2 Library ConnectingBlocks.PNG</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=Datei:WindowsAutomation2_Library_ConnectingBlocks.PNG&amp;diff=11263"/>
		<updated>2018-05-28T11:54:37Z</updated>

		<summary type="html">&lt;p&gt;Lv: The Windows Automation 2 library&amp;#039;s blocks for handling connections.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Windows Automation 2 library&#039;s blocks for handling connections.&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11262</id>
		<title>WindowsAutomation Reference 2.0</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11262"/>
		<updated>2018-05-28T11:38:22Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the documentation for the Windows Automation 2.0 plugin.&lt;br /&gt;
&lt;br /&gt;
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
*Automated GUI testing of WPF, WinForms, and Win32 applications.&lt;br /&gt;
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.&lt;br /&gt;
*Parallel remote test-execution on multiple systems.&lt;br /&gt;
*Performs tests against already built executables. No source code changes / recompilation of the application is required.&lt;br /&gt;
*Access to GUI components using XPath locators.&lt;br /&gt;
*Access objects of the application live at execution time.&lt;br /&gt;
*Full access to keyboard and mouse of the target system.&lt;br /&gt;
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...&lt;br /&gt;
&lt;br /&gt;
=Installation and Connection=&lt;br /&gt;
The WindowsAutomation testing plugin uses the expecoo &amp;quot;.NET-Bridge&amp;quot; which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
On the machine running the system under test:&lt;br /&gt;
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.&lt;br /&gt;
* One of the following operation systems:&lt;br /&gt;
::- Windows 7 SP1&lt;br /&gt;
::- Windows 8&lt;br /&gt;
::- Windows 8.1&lt;br /&gt;
::- Windows 10&lt;br /&gt;
&lt;br /&gt;
::- Windows Server 2008 R2 SP1&lt;br /&gt;
::- Windows Server 2012&lt;br /&gt;
::- Windows Server 2012 R2&lt;br /&gt;
::- Windows Server 2016&lt;br /&gt;
::- Windows Server, version 1709&lt;br /&gt;
&lt;br /&gt;
==Plugin Components==&lt;br /&gt;
The plugin consists of the following parts:&lt;br /&gt;
* The GUI Browser, used to interactively explore your application.&lt;br /&gt;
* The Windows Automation Library, which provides blocks that you can use in your test cases.&lt;br /&gt;
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.&lt;br /&gt;
&lt;br /&gt;
==Installing and Configuring the Plugin in Expecco==&lt;br /&gt;
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the &amp;quot;plugin&amp;quot; subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Preparing a local system for test execution==&lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Everythint should work out of the box.&lt;br /&gt;
&lt;br /&gt;
{{To do|inner=Is that still true with the gui browser?}}&lt;br /&gt;
{{To do|inner=Pictures for the connection process}}&lt;br /&gt;
&lt;br /&gt;
==Preparing a remote system for test exeuction==&lt;br /&gt;
The remote system will have to run the &amp;quot;.Net-Bridge server&amp;quot; which in turn connects to expecco. &lt;br /&gt;
You just need to copy &amp;quot;DotNetBridgeServer.exe&amp;quot; to the computer your system under test is running on. No further installation is needed.&lt;br /&gt;
&lt;br /&gt;
To start the bridge, navigate to the executable in a shell and start it with the following arguments:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Arguments !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| -s || Yes || Tells the executable to run in server mode (as opposed to client mode).&lt;br /&gt;
|-&lt;br /&gt;
| -k || Yes || Tells the client to keep the connection open after aconnection has been terminated saving you the hassle to restart it every time a test finishes.&lt;br /&gt;
|-&lt;br /&gt;
| -a &amp;lt;ip/hostname&amp;gt;|| Yes || The IP-Address of the PC your application is running on.&lt;br /&gt;
|-&lt;br /&gt;
| -p &amp;lt;int&amp;gt; || No || The port the server should listen on (default is 34318).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
{{To do|inner=What settings does the plugin have?}}&lt;br /&gt;
&lt;br /&gt;
=GUI Browser=&lt;br /&gt;
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description on how to use and what to do with the GUI browser also see [[Expecco GUI Tests Extension Reference]].&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11261</id>
		<title>WindowsAutomation Reference 2.0</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11261"/>
		<updated>2018-05-28T11:37:31Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the documentation for the Windows Automation 2.0 plugin.&lt;br /&gt;
&lt;br /&gt;
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
*Automated GUI testing of WPF, WinForms, and Win32 applications.&lt;br /&gt;
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.&lt;br /&gt;
*Parallel remote test-execution on multiple systems.&lt;br /&gt;
*Performs tests against already built executables. No source code changes / recompilation of the application is required.&lt;br /&gt;
*Access to GUI components using XPath locators.&lt;br /&gt;
*Access objects of the application live at execution time.&lt;br /&gt;
*Full access to keyboard and mouse of the target system.&lt;br /&gt;
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...&lt;br /&gt;
&lt;br /&gt;
=Installation and Connection=&lt;br /&gt;
The WindowsAutomation testing plugin uses the expecoo &amp;quot;.NET-Bridge&amp;quot; which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
On the machine running the system under test:&lt;br /&gt;
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.&lt;br /&gt;
* One of the following operation systems:&lt;br /&gt;
::- Windows 7 SP1&lt;br /&gt;
::- Windows 8&lt;br /&gt;
::- Windows 8.1&lt;br /&gt;
::- Windows 10&lt;br /&gt;
&lt;br /&gt;
::- Windows Server 2008 R2 SP1&lt;br /&gt;
::- Windows Server 2012&lt;br /&gt;
::- Windows Server 2012 R2&lt;br /&gt;
::- Windows Server 2016&lt;br /&gt;
::- Windows Server, version 1709&lt;br /&gt;
&lt;br /&gt;
==Plugin Components==&lt;br /&gt;
The plugin consists of the following parts:&lt;br /&gt;
* The GUI Browser, used to interactively explore your application.&lt;br /&gt;
* The Windows Automation Library, which provides blocks that you can use in your test cases.&lt;br /&gt;
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.&lt;br /&gt;
&lt;br /&gt;
==Installing and Configuring the Plugin in Expecco==&lt;br /&gt;
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the &amp;quot;plugin&amp;quot; subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Preparing a local system for test execution==&lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Everythint should work out of the box.&lt;br /&gt;
&lt;br /&gt;
{{To do|inner=Is that still true with the gui browser?}}&lt;br /&gt;
{{To do|inner=Pictures for the connection process}}&lt;br /&gt;
&lt;br /&gt;
==Preparing a remote system for test exeuction==&lt;br /&gt;
The remote system will have to run the &amp;quot;.Net-Bridge server&amp;quot; which in turn connects to expecco. &lt;br /&gt;
You just need to copy &amp;quot;DotNetBridgeServer.exe&amp;quot; to the computer your system under test is running on. No further installation is needed.&lt;br /&gt;
&lt;br /&gt;
To start the bridge, navigate to the executable in a shell and start it with the following arguments:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Arguments !! Description || Required&lt;br /&gt;
|-&lt;br /&gt;
| -s || Tells the executable to run in server mode (as opposed to client mode). || {{Checked}}&lt;br /&gt;
|-&lt;br /&gt;
| -k || Tells the client to keep the connection open after aconnection has been terminated saving you the hassle to restart it every time a test finishes.  || {{Checked}}&lt;br /&gt;
|-&lt;br /&gt;
| -a &amp;lt;ip/hostname&amp;gt;|| The IP-Address of the PC your application is running on. || {{Checked}}&lt;br /&gt;
|-&lt;br /&gt;
| -p &amp;lt;int&amp;gt; || The port the server should listen on (default is 34318) || {{Checked}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
{{To do|inner=What settings does the plugin have?}}&lt;br /&gt;
&lt;br /&gt;
=GUI Browser=&lt;br /&gt;
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description on how to use and what to do with the GUI browser also see [[Expecco GUI Tests Extension Reference]].&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11260</id>
		<title>WindowsAutomation Reference 2.0</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=WindowsAutomation_Reference_2.0&amp;diff=11260"/>
		<updated>2018-05-28T11:34:39Z</updated>

		<summary type="html">&lt;p&gt;Lv: Die Seite wurde neu angelegt: „This is the documentation for the Windows Automation 2.0 plugin.  It provides facilities to automate tests incorporating applications with a GUI based on Windo…“&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the documentation for the Windows Automation 2.0 plugin.&lt;br /&gt;
&lt;br /&gt;
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
*Automated GUI testing of WPF, WinForms, and Win32 applications.&lt;br /&gt;
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.&lt;br /&gt;
*Parallel remote test-execution on multiple systems.&lt;br /&gt;
*Performs tests against already built executables. No source code changes / recompilation of the application is required.&lt;br /&gt;
*Access to GUI components using XPath locators.&lt;br /&gt;
*Access objects of the application live at execution time.&lt;br /&gt;
*Full access to keyboard and mouse of the target system.&lt;br /&gt;
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...&lt;br /&gt;
&lt;br /&gt;
=Installation and Connection=&lt;br /&gt;
The WindowsAutomation testing plugin uses the expecoo &amp;quot;.NET-Bridge&amp;quot; which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
On the machine running the system under test:&lt;br /&gt;
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.&lt;br /&gt;
* One of the following operation systems:&lt;br /&gt;
::- Windows 7 SP1&lt;br /&gt;
::- Windows 8&lt;br /&gt;
::- Windows 8.1&lt;br /&gt;
::- Windows 10&lt;br /&gt;
&lt;br /&gt;
::- Windows Server 2008 R2 SP1&lt;br /&gt;
::- Windows Server 2012&lt;br /&gt;
::- Windows Server 2012 R2&lt;br /&gt;
::- Windows Server 2016&lt;br /&gt;
::- Windows Server, version 1709&lt;br /&gt;
&lt;br /&gt;
==Plugin Components==&lt;br /&gt;
The plugin consists of the following parts:&lt;br /&gt;
* The GUI Browser, used to interactively explore your application.&lt;br /&gt;
* The Windows Automation Library, which provides blocks that you can use in your test cases.&lt;br /&gt;
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.&lt;br /&gt;
&lt;br /&gt;
==Installing and Configuring the Plugin in Expecco==&lt;br /&gt;
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the &amp;quot;plugin&amp;quot; subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Preparing a local system for test execution==&lt;br /&gt;
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Everythint should work out of the box.&lt;br /&gt;
&lt;br /&gt;
{{To do|inner=Is that still true with the gui browser?}}&lt;br /&gt;
{{To do|inner=Pictures for the connection process}}&lt;br /&gt;
&lt;br /&gt;
==Preparing a remote system for test exeuction==&lt;br /&gt;
The remote system will have to run the &amp;quot;.Net-Bridge server&amp;quot; which in turn connects to expecco. &lt;br /&gt;
You just need to copy &amp;quot;DotNetBridgeServer.exe&amp;quot; to the computer your system under test is running on. No further installation is needed.&lt;br /&gt;
&lt;br /&gt;
To start the bridge, navigate to the executable in a shell and start it with the following arguments:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Arguments !! Description&lt;br /&gt;
|-&lt;br /&gt;
| -s || Tells the executable to run in server mode (as opposed to client mode).&lt;br /&gt;
|-&lt;br /&gt;
| -k || Tells the client to keep the connection open after aconnection has been terminated saving you the hassle to restart it every time a test finishes.&lt;br /&gt;
|-&lt;br /&gt;
| -a &amp;lt;ip/hostname&amp;gt;|| The IP-Address of the PC your application is running on.&lt;br /&gt;
|-&lt;br /&gt;
| (OPTIONAL) -p &amp;lt;int&amp;gt; || The port the server should listen on (default is 34318)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
{{To do|inner=What settings does the plugin have?}}&lt;br /&gt;
&lt;br /&gt;
=GUI Browser=&lt;br /&gt;
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description on how to use and what to do with the GUI browser also see [[Expecco GUI Tests Extension Reference]].&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
	<entry>
		<id>https://doc.expecco.de/index.php?title=GUI_Testing&amp;diff=11259</id>
		<title>GUI Testing</title>
		<link rel="alternate" type="text/html" href="https://doc.expecco.de/index.php?title=GUI_Testing&amp;diff=11259"/>
		<updated>2018-05-28T10:33:43Z</updated>

		<summary type="html">&lt;p&gt;Lv: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[Expecco GUI Tests_Extension Reference|GUI Browser: Gemeinsame Basis der verschiedenen GUI Test Erweiterungen]]&amp;lt;br&amp;gt;Diese Erweiterung dient als Basis für die verschiedenen UI Technologieanbindungen. Sie ist Voraussetzung für (und beinhaltet in) den Erweiterungen für die Java GUI, Mobile GUI, Qt und Windows Automation GUI Erweiterungen.&lt;br /&gt;
&lt;br /&gt;
* [[Java GUI Plugins|Java Swing/SWT UI Testing]]&amp;lt;br&amp;gt;Diese Erweiterungen stellen Schnittstellen zu Anwendungen mit Java GUIs, basierend auf Swing und/oder SWT bereit.&lt;br /&gt;
&lt;br /&gt;
* [[Mobile Testing Plugin|Mobile Testing auf Android und iOS]]&amp;lt;br&amp;gt;Diese Erweiterung bietet Zugriff auf Mobilgeräte basierend auf Android und iOS. Die Kommunikation erfolgt über eine Appium-Schnittstelle.&lt;br /&gt;
&lt;br /&gt;
* [[VNC Plugin Reference|UI Testing über VNC]]&amp;lt;br&amp;gt;Diese Erweiterung realisiert den Zugriff auf UI-Anwendungen über die VNC (RFB) Schnittstelle. Mit dieser können beliebige Anwendungen getestet werden (sofern ein VNC-Server auf dem Zielsystem erreichbar ist), allerdings sind Attribute nur sehr eingeschränkt abrufbar. Sie dient daher vornehmlich als Fallback-Lösung, falls andere Plugins nicht zum Einsatz kommen können.&lt;br /&gt;
&lt;br /&gt;
* [[Qt Plugin Reference|UI Testing von Qt-Anwendungen]]&amp;lt;br&amp;gt;Diese Erweiterung realisiert den Zugriff auf UI-Anwendungen basierend auf dem Qt Framework.&lt;br /&gt;
&lt;br /&gt;
* [[OpenETS Plugin Reference|UI Testing von OpenETS-Anwendungen]]&amp;lt;br&amp;gt;Diese Erweiterung realisiert den Zugriff auf UI-Anwendungen basierend auf dem OpenETS Framework. OpenETS (&amp;quot;Open Expecco Test Service&amp;quot;) ist eine von eXept erhältliche C-Bibliothek, die Entwickler zu ihrem C-Programm binden, und die Kommunikation mit expecco übernimmt. Damit können beliebige C/C++ Anwendungen automatisiert werden.&lt;br /&gt;
&lt;br /&gt;
* [[WindowsAutomation Reference 2.0|UI Testing mit der Windows Automation Library]]&amp;lt;br&amp;gt;Realisiert den Zugriff auf Windows Anwendungen über die UI Automation Schnittstelle - Version 2.0&lt;br /&gt;
&lt;br /&gt;
* [[WindowsAutomation Reference 1.0|Windows Automation GUI Access Interfacing Library 1.0]]&amp;lt;br&amp;gt;Realisiert den Zugriff auf Windows Anwendungen über die UI Automation Schnittstelle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[AutoIt Library|AutoIt GUI Interface Library]]&amp;lt;br&amp;gt;Bietet Zugriff auf Windows Anwendungen über AutoIt. Dies ist eine Low-Level Schnittstelle, welche nur eine eingeschränkte Sicht der Attribute von Komponenten erlaubt. Allerdings kann damit jedes GUI angesprochen werden, unabhängig von dessen darunterliegenden Technologie. Es ist daher oft hilfreich, wenn keinerlei Information über die Struktur des GUIs vorliegt.&lt;/div&gt;</summary>
		<author><name>Lv</name></author>
	</entry>
</feed>