SAP GUI packages a UI scripting engine (SAPFEWSELib) as a native library out-of-box which exposes an accessibility library. SAP generated GUI VBscript didn’t give much around control and needs some trial and error based on ControlID, method name and property name to find out what control is required to write the test in C#. VBScript cannot run without a host environment and it is required to write either C#.NET or VB.NET code to run VBScript. Generated VBScript is only called from SAP and Visual Studio cannot execute it. VBScript is an outdated platform and it is difficult to extend the generated code to read data from text/XML/Excel files or to connect to SQL server where setup/validation data may reside. VBScript from SAP is all action oriented which means the script can be recorded only if you perform actions on controls like ‘click’ or ‘write’. For example, read action from a text box or validate a quantity in a Sales Order is not possible unless you write extra VBscript and store it in variables. Writing VBScript is more of a learning curve than writing in C#.NET code. To execute VBScript, you need to open and navigate a few steps in SAP and import the script to execute which means not fully automated. Test management is also hard with VBscripts. These are just flat files and there is no effective way to manage these scts like Microsoft Test manager is for .NET based scripts. Debugging is even harder since the script executes only in SAP environment, you can’t put breakpoints and debug. Otherwise adopting .NET based SAP GUI scripting would include digesting large set of GUI classes and their members. It was crucial to get a handle of SAP sessions and every GUI control of the SAP Desktop app. The solution built contains all the class members as the conversion to C# occurs. A test framework was built with multiple automated tests which consolidated highly readable code and test data in Visual Studio project. In summary, a plugin which automatically converts the VB.net scripts to C#.net for SAP GUI has been developed.
|