Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

eCATT - how to run multiple test scripts with input variables in different test scripts?

Former Member
0 Kudos

Hi SAP gurus,

SECATT -->

I have been trying to create a simple sales process test script, for that I am using MM01 transaction as one test script, VK11 as another test script and finally VA01 as the last test script. I'm using another test script to bring them all together, But by doing this i cannot use the test configurations file since the variables are not showing in the new test script where I brought everything together.

eCATT - Test script which links the other test scripts (MM01, VK11,VA01)

*Create Material 1 MM01

REF ( Z_MATERIAL_CREATION_1 , Z_MATERIAL_CREATION_1_REF ).

*Create VK11

REF ( Z_PRICE_CREATION_1 , Z_PRICE_CREATION_1_REF).

*Create sales order VA01

REF (Z_SALES_ORDER_CREATION_TS , Z_SALES_ORDER_CREATION_R).

How do I use the Test configuration file for this, where I can import data to variable in different test scripts?

Thank you and regards,

1 ACCEPTED SOLUTION

pb3030
Explorer
0 Kudos

Hi Hellanga,

The individual scripts are called as Test Scripts (TS) and the script in which you are referring all these individual test scripts is call as Master test script (MTS).

Make sure that all the parameters that you want to be visible in the MTS are declared as IMPORT paramtere in the individual TS.

Then proceed with the Test configuration (TC).

For more details please refer the links below.

http://scn.sap.com/docs/DOC-8235

7 REPLIES 7

pb3030
Explorer
0 Kudos

Hi Hellanga,

The individual scripts are called as Test Scripts (TS) and the script in which you are referring all these individual test scripts is call as Master test script (MTS).

Make sure that all the parameters that you want to be visible in the MTS are declared as IMPORT paramtere in the individual TS.

Then proceed with the Test configuration (TC).

For more details please refer the links below.

http://scn.sap.com/docs/DOC-8235

Former Member
0 Kudos

Thanks for the reply, I have gone passed that,

but there is a new problem,

I need to create a sales order with 'n' number of schedule lines. I thought of using DO(COUNT). --> ENDDO. An when I run the script the log does not show any errors. But when i try to use a data container which the data is in a excel (text) file the script does not work. It runs only once and errors out without adding the rest of the schedule lines.

How do you make it import values from the excel sheet?

The code in editor,

I_COUNT  --> Ref Parameter COUNT

*Adding I_COUNT amount  of Schedule line

DO(I_COUNT).

SAPGUI ( VA01_2010_STEP_41 ). --> entering Grid name

SAPGUI ( VA01_5000_STEP_5 ).--> entering Grid value

*Pressing Enter on schedule line

*SAPGUI ( VA01_2010_STEP_42 ).

SAPGUI ( VA01_2010_STEP_42_1 ).

*This clicks on to the next line.

SAPGUI ( VA01_2010_STEP_42_2 ).

ENDDO.

Please help me out. Thanks

Former Member
0 Kudos

Hi Prakash,

I'm recording sales order creation which have several schedule lines (The delivery dates can change).
I read up on most of the ecatt documents and I believe i have a reasonable amount of knowledge.
From my understanding when entering schedule lines, the ecatt keeps track of the column and row.
This is recorded J_3ASZDI-J_3ASIZED[2,0] as the GuiElement ID.

I have added a loop to make repeat different schedule lines, the code is down bellow.

I_COUNT  --> Ref Parameter COUNT

*Adding I_COUNT amount  of Schedule line

DO(I_COUNT).

SAPGUI ( VA01_2010_STEP_41 ). --> entering Grid name GUIELEMENT ID - J_3ASZDI-J_3ASIZED[2,0]

SAPGUI ( VA01_5000_STEP_5 ).--> entering Grid value GUIELEMENT ID - J_3ASZDI-J_3ASIZED[3,0]

*Pressing Enter on schedule line

*SAPGUI ( VA01_2010_STEP_42 ).

SAPGUI ( VA01_2010_STEP_42_1 ).

*This clicks on to the next line.

SAPGUI ( VA01_2010_STEP_42_2 ).---> GUIELEMENT ID - J_3ASZDI-J_3ASIZED[2,1]

ENDDO.

My question is even if you add a loop in to the SAPGUI (Creating schedule line and next line), since the GuiElement ID has [2,1]  --> [Column,Row] on next schedule line it wont full fill the loop. does the DO(x) function disregards this GuiElement ID or is this and issue? If so, is there another way?

Please reply as soon as you can. I need to show this to my supervisor on friday.
Thanks and regards,
Hellanga

0 Kudos

You need to work with an internal table where you maintain the different line items.

To declare an internal table you have to maintain a reference table on your parameter list:

It will look like that:

Don’t forget the squared brackets.

Do a double click on the field which is now filled with <INITIAL> to enter your line values.

In the Script you work than with a loop:

* Fill all Item Details

  GETLEN ( I_VBAP , V_DO ).

  DO ( V_DO ).

* Assign Values

    V_UEPOS = I_VBAP[&LPC]-UEPOS.

    V_MATNR = I_VBAP[&LPC]-MATNR.

    V_KWMENG = I_VBAP[&LPC]-KWMENG.

    V_VRKME = I_VBAP[&LPC]-VRKME.

    V_KBETR = I_VBAP[&LPC]-NETWR.

    V_PSTYV = I_VBAP[&LPC]-PSTYV.

    V_WERKS = I_VBAP[&LPC]-WERKS.

    V_LGORT = I_VBAP[&LPC]-LGORT.

    V_KDMAT = I_VBAP[&LPC]-KDMAT.


* Fill line item


Your SAPGUI Commands for the  line item

SAPGUI with scrolling or Button for new line

ENDDO.

Your actual script within the loop will now work with the local variables like V_MATNR etc..

With each do, you fill now a line, but it will be always the same line, so include the button for insert new line or scroll after each record in your recording to get the line free for the next entry.

Rgds

Christian

Former Member
0 Kudos

I am a newbie and your answer is easily understandable.

Truly grateful for the explanation.

Thanks a lot.

Former Member
0 Kudos

Hi Christian Koch,

I was also wondering whether we can use multiple test data containers where we Import data from multiple excel sheets in to a test configuration.

for example by recording sales order -->1

1. Test script 1 --> using va01 - create sales order and enter header data. -->save

2. Test script 2 --> using va02 - change sales order and enter line item data --> save

3. Test script 3 --> using va02 - change sales order and enter schedule line data --> save

4. Having different test data containers for each of the test scripts,

5. Combining the test scripts in to one test script --> Test script final

now once you the test configuration is made, by adding the three test data containers, CAN I USE TREE DIFFERENT EXCEL SHEETS TO UPLOAD DATA? is this possible?

Please respond ASAP.

Thanks for your help.

0 Kudos

You could work on 1 Final Script (or Master Script) via test configuration with one Excel-File, but you can assign more than one data container to the test configuration so that you can combine your test data container. You need to merge your excel file to one file, than it should work.

Rgds

Christian