SAP is currently a well-known and leading ERP system, when testing software systems that interact with SAP, it is often necessary to use SAP GUI Client to perform certain routine operations, such as creating test data. These operations are characterized by the need for certain SAP knowledge and skills, lengthy steps, time-consuming consumption, strong repeatability, and so on. In order to improve efficiency, reduce the workload of testers and developers, the automated way to complete data preparation is our first thought. Script Center is a self-developed SAP automated testing tool that we can use to automate the preparation of test data by performing a VBS script that operates SAP AutoIt. Users can also easily edit the data values to be created through Script Center to create a number of different test data.
The question of the proposed
The author's department is responsible for the development and testing of an E-commerce application system, this system and SAP interaction frequently. We often need to prepare some test data in SAP. Previously, the preparation of this data was usually done manually in the SAP GUI client, referring to the Help document, step-by-step implementation. The whole process is time-consuming, repetitive, and uninteresting. In addition, these operations are often complex, usually by a few people who are familiar with SAP operations and understand the business logic of the E-business application system. There is a lot more to test data in the more demanding phases of a task, so the requests for other people to create test data are sometimes deferred. Therefore, the project team urgently needs a convenient and quick way to prepare test data in SAP, reduce the work pressure and improve the working efficiency.
Scenario Description
Automated preparation data is our first thought solution, and SAP has its own recording and playback capabilities. The last recorded script is the VBS format, which can be replayed by double-clicking the VBS file. But the simple replay script does not satisfy the user to the data request, we need to parameterize this data, the user may fill in according to own need the data which oneself wants. Because XML editing does not have special requirements for the software, it is easy to edit and ultimately decides to save the data in XML format. Since the user can edit XML directly to cause errors, we can access and edit these data fields amicably with the Script Center developed by AutoIt. Script Center can also centrally manage scripts so that users have an easier interface to run the scripts they need.
Overall architecture Design
Figure 1. Schema diagram
You can see the design of our Script Center from the schema diagram, which is explained in terms of workflow:
All user actions need to be done only on the GUI of Script Center;
View all the VBS scripts for automated SAP through Script Center and execute the VBS script;
Easily view and modify the data files required by the script through the Scripts center;
Script read the corresponding data file, through SAP GUI client to SAP operation, complete SAP automation;
To facilitate the centralized maintenance of SAP logged-in users, script needs to read SAP login information from DB, and after the script completes, saves the record to db while generating the corresponding log file.
System implementation
Premise:
The client needs to install the script Center,sap GUI client,autoit
Deploy Web Service,vbs scripts on DB2 server to interact with Web Service and database
AutoIt Introduction
AutoIt is a freeware program for writing and generating script programs with BASIC language style, which is used to automate a variety of tasks in Windows (such as automating the installation of target programs, completing various automation operations, etc.). It lets you automate tasks by combining analog keyboard keys, mouse Movements and window/control operations, and you can use it to develop your own GUI for better interaction, plus it can convert its script language into an EXE executable.