Desktop applications are becoming increasingly heterogeneous. A long time we must concentrate our attention only to the SAP GUI for Windows, the primary UI to an SAP system in business. But more and more switches it over to the WebUI. In this blog I will present a solution, how to control different kinds of desktop applications with one approach.
In the centre of our attention is PowerShell, the scripting language of the Microsoft Windows platform, which is the standard on clients in business environments. PowerShell is available from Windows 7 to the actual release Windows 10 and offers an easy to use interface to the dotNET universe. You can supply PowerShell from different sources to automate your environment.
Scripting Tracker is a utility and a replacement to the SAP GUI Scripting Development Tools. It is a SAP GUI analyzer, comparator and a recorder on SAP GUI Scripting base, also it includes a SAP GUI Scripting API viewer. It includes with its recorder the possibility to build PowerShell scripting language code easily from your activities on the SAP GUI for Windows.
With Selenium you can automates browsers. With the Selenium IDE, a Firefox add-on, you can record your activities and export it as C# code. With minor changes you can use this code in PowerShell with the C# WebDriver, you can find an example here.
AutoIt is designed for automating the Windows GUI. With its COM interface it is also possible to use SAP GUI Scripting direct, you can find an example here – by the way, Scripting Tracker supports AutoIt. AutoIt offers different kinds of possibilities, also a scripting recorder and AutoItX, a combined COM and DLL version of AutoIt, with dotNET interface. This variety of possibilities offers different ways to control automated activities on the Windows UI in the context of PowerShell.
The different kinds of desktop applications contains for automatization approaches difficulties. But with the combination of
- SAP GUI Scripting and Scripting Tracker, to control the SAP GUI for Windows, and
- Selenium, to control the WebUI via WebDriver on different browsers like Microsoft Edge, Google Chrome or Mozilla FireFox and
- Appium, to control native or web apps on mobile devices like Android or iOS and
- AutoIt, to control the native Windows UI and
- dotNET Connector NCo to communicate with an SAP backend system directly
in the context of PowerShell, which offers interfaces to the Windows OS and dotNET, you have a phantastic toolset to encounter this challenge. The architecture map above visualized this scenario.
I use very often SAP GUI Scripting with Scripting Tracker and AutoItX, to control the SAP GUI for Windows and the native Windows UI with PowerShell. It is very handy and it works very good. You can find a lot of examples in my collection of my posts here in the SAP Community. But more and more I use Selenium with Mozillas FireFox add-in to record my activities on an SAP WebUI. This method is not yet been consolidated, but the future perspective, that the UI of SAP applications runs more and more on browsers, challenges me. Former Member wrote in his very interesting blog Test Automation of your Web Application using Modern Frameworks/Tools about SAP START (Simple Test Automation for Regression Tests). The architecture of START is basically very near to this approach.