Welcome To Automation Testing

Before starting with tips of automation of SAP using QTP Let me give a small introduction of SAP and QTP.

SAP stands for System Applications and Products. It is the name of both the online financial and

Administrative software and the company that developed it. SAP is made up of individual modules that perform various organizational system tasks.



Quick Test Professional (QTP) is an automated functional Graphical User Interface (GUI) testing tool that allows the automation of user actions on a web or client based computer application.

It is primarily used for functional regression test automation. QTP uses a scripting language built on top of VBScript to specify the test procedure, and to manipulate the objects and controls of the application under test. It supports many applications through the support of add-ins.



We will be using SAP add-in with QTP to work on the SAP automation.

Wednesday 4 July 2012

Bad Length Error

This is very common issue with SAP.

There are few fields in SAP which throws 'Bad Length' error on setting values into it during run time(using Script). However you will be able to set the values manually.

The problem is with the length assigned to such field during run session. The field length is usually smaller ,say 4, at runtime. So if you are trying to set a value of length more than 4, you will get this error.

I figured out a way of doing with using the below undocumented method.

SAPGuiSession("Session").SAPGuiWindow("Display ").SAPGuiEdit("<Field>").Object.text="<Your Text>"

The above code worked fine for me.

Hope this will help few of you.

2 comments:

  1. Hi Ankesh,

    I had the same problem and I used the above solution but still I face a general error at the same SAPGUIEdit. The error does not come frequently though but once in a day and I am not able to replicate it.

    Thanks,
    Rifatra

    ReplyDelete
  2. ok thanks for this post it's quite informative and I have learned new things.

    KissAnime alternative

    ReplyDelete