Application Development and Automation 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: 
Read only

Validation before running test script?

Former Member
0 Likes
756

Hello Gurus,

I am getting started to learn eCATT and with different posts availabe I was sucessfully able to create and execute simple scripts. Thanks for posting all this and I am now able to create all four objects in eCATT. A special thanks to Sapna Modi for her step wise information.

However, I have certain conditions to check before running test script. Like I want to check a table entry and if the entry exists then the test script should be executed. I tried with ABAP ...ENDABAP and TCD recording. I wasnt able to do it.

Could anyone of you please let me know how we can accomplish this? Also when the entry isnt there in the table the test script should fail and appropriate message should be displayed in the log.

Also, please let me know if we can use TCD and SAPGUI commands within ABAP ENDABAP commands.

Your help is highly appreciated...

Regards,

GS...

1 ACCEPTED SOLUTION
Read only

venkatesh_sakthivel
Active Participant
0 Likes
631

Hi ,

Answers to your question,

1.I have certain conditions to check before running test script. Like I want to check a table entry and if the entry exists then the test script should be executed ?

Ans:You Can use GETTAB/CHETAB command in eCATT pass the table name you want to check.It will create a interface and parametetize the field to apply check

2.when the entry isnt there in the table the test script should fail and appropriate message should be displayed in the log.

Ans:Use CHETAB command for this.In the log you would get a messge saying the entry couldnt find and the check as failed.If you want more appropriate you can use a Logmsg command to write out something

Regards,

Venky

4 REPLIES 4
Read only

venkatesh_sakthivel
Active Participant
0 Likes
632

Hi ,

Answers to your question,

1.I have certain conditions to check before running test script. Like I want to check a table entry and if the entry exists then the test script should be executed ?

Ans:You Can use GETTAB/CHETAB command in eCATT pass the table name you want to check.It will create a interface and parametetize the field to apply check

2.when the entry isnt there in the table the test script should fail and appropriate message should be displayed in the log.

Ans:Use CHETAB command for this.In the log you would get a messge saying the entry couldnt find and the check as failed.If you want more appropriate you can use a Logmsg command to write out something

Regards,

Venky

Read only

0 Likes
631

Hi Venky,

I tried with CHETAB command, even though the entry isnt there in the table the script gets executed. Let me be clear as what I am doing...

I am using TCD command to run a script, once this script runs, I am checking for table entries using CHETAB command, if the entries are there in the table then the next TCD command should be executed. My script runs fine for a positive business scenario. However when I test negative scenario, i.e., no table entries the next script also gets executed.

Your help is highly appreciated in this regard...

Thanks & Regards,

GS

Read only

0 Likes
631

Hi,

For your negative testing,if your entry is not listed in the table.Eventually CHETAB command wil fail and you see a Red log.

For not executing the script,if your check fails.Please add some condition..

In CHETAB/GETTAB table commands,Say you passed a value and it is found in the table.Then the return value for the CHETAB/GETTAB would be zero.If it is failed it return Non-zero values.This values can be captured by using the command &SUBRC.

So please apply a condition for your next script to execute..

If &SUBRC = 0

give the script name

else

log(condition failed)

endif.

just add this code in between your code..and place the script you wanna execute after your check is successful.

Hope it answers your doubts.

Regards,

Venky

Read only

0 Likes
631

Hi Venky,

Thanks for your help, I was able to do it sucessfully now.

Regards,

GS