Friday, August 12, 2011

SAP Automation Tool for Free...

It was a regular Thursday afternoon. I had finished my hot cup of milk and making plans for the weekend. My friends were proposing that we catch up early on Friday evening and go for a movie followed by dinner and then crash at one of our houses. I was making grandiose plans which began with me leaving office at 4 PM when out of the blue I got a call from a Senior Manager of one of the key accounts asking me if I could help out her team in testing their SAP Application because a few members of her team had called in sick today and would not be available the next day as well. I cringed initially because if I said YES it meant I would not be able to leave early but on the other hand if I said NO, it would mean that I miss out on the chance to work on a really cool SAP Application on a module which I am fascinated by.
                Well! There I was on Friday morning bright and chirpy; rubbing my hands in delight at the thought of dueling with my fascinating SAP Application. (Hey don’t get me wrong here; I had taken sufficient pains to ensure that I rescheduled my weekend plans with friends so I could have the best of both worlds). Murali, the Test Lead arrived and after the usual Howdy’s exchanged, we got down to business. So Murali, I asked what is in store for me? Give me some really challenging, exciting test cases to execute. Murali allocated four test cases and said try finishing these by end of day. Well four test cases are not really that much right and I took a quick glance at how many steps each of the test cases comprised of. On average, each test case had about 15 steps so I rejoiced thinking that I could still manage to get off early as planned initially but then I asked Murali are you sure that’s it? I could do more you know. Murali gave me a wicked smile (I would soon know the reason for it) and said you execute these first and then let’s see.
                I logged in to Quality Center and got down to the business of executing the test cases (at the back of my head, I thought hey here’s a chance for me to impress all and sundry with the speed at which I can execute test cases and find defects) . The first few steps went on smoothly and eventually I came to the monster step. Monster because here was a step, where I had to copy and paste values from an excel sheet to the SAP application for 150 rows. Sounds pretty simple so far doesn’t it? But here’s the catch, I could copy and paste only about 7 rows at a time because the limitation was that I could paste in to the table in the SAP application values only for as many rows as that were visible in the SAP table. Now that’s not the end of it, these values had to be pasted column wise because the excel sheet did not account for all the columns that were present in the SAP table and just copying and pasting from excel on to the SAP table, would lead to values being pasted in random columns which were incorrect.
                The reason for Murali’s wicked smile suddenly dawned on him and after going through the painful process of copying and pasting 7 rows at a time for about 8 columns I was completely exhausted and bored and clawed my way to Murali’s desk asking if there was a better way that he knew of in which this could be achieved. Automation was the only option that we could think of to perform this incredibly boring task. But for automation, we would need QTP and if we need QTP, we need money and loads of it which was not budgeted for in the project. So I then resigned myself to the task of completing the other test cases which were quite similar to the first one and somehow managed to survive the hazards of copying and pasting values an infinite number of times. I was relieved by the time I completed the execution of all four test cases and thanked God that it was a Friday and left office.
                Monday morning, I narrated my horror story to my team mates (which they seemed to enjoy by the way) and vowed to find a better way to accomplish this incredibly boring task. I Googled a bit, spoke to a couple of my team mates and we hit upon the idea of using “SAP GUI Scripting” to perform these kind of repetitive tasks. It was free, easy to use, and available on all SAP GUI applications and needed very little grey matter to get started on using it. I immediately got down to trying it out on one of the SAP GUI applications that I had access to and voila it was a breeze to use it. The test case that I took 2 hours to execute earlier was now easily executed in less than 10 minutes with “SAP GUI Scripting” and the use of some simple excel macros.
                Now, that was my moment of truth. All it required was just a little bit of googling, a little bit of perseverance and a desire to make things easier for the lazy me.
                Some basics of using SAP GUI Scripting –
·         Log in to SAP GUI
·         Click on the ‘Customize Layout Button’ and select the ‘Script Recording and Playback’ option
·         The ‘Record and Playback’ widget will be displayed
·         Click on the ‘Record Script’ button
·         Perform the process that needs to be automated and after recording, click on the ‘Stop Recording’ button
·         Click on the ‘More’ button and ‘Save’ the file in desired location (the file will be saved in “.vbs” format)
·         To run the recorded script, click on the ‘Playback Script’ button
Note – in some of the SAP Servers, the value of ‘sapgui/user_scripting’ parameter may not be set to TRUE. To enable scripting on the server, navigate to the ‘RZ11’ transaction, enter the ‘Param. Name’ as – “sapgui/user_scripting”.

Click on ‘Display’ button and change the ‘Current Value’ field to “TRUE” and click on ‘Save’

3 comments:

  1. I have to say i think your priorities are in the wrong order. Friends and leisure should come before sap partners, not after them.

    ReplyDelete
  2. Thanks for sharing the post. This post have some nice topics shared and have nice knowledge oriented content.
    Sap Test Automation Services

    ReplyDelete
  3. Informative Blog. well explained. Test automation tools now a days playing an important role in every organisation
    Automation testing services

    ReplyDelete