It's all about the answers!

Ask a question

Reusability - Test Script and Keyword


vinitha dsouza (61634) | asked Dec 20 '18, 1:22 a.m.
Hello RQM Experts,

In RQM,  meta model defines,
Test Case -> Test scripts(1...n)-> Keywords(1.n)
as per my knowledge Test Scripts are components which i can reuse. Same applies for Keywords also.

for eg: if i a take login of web application. I can create Test script having below steps,
Test script Name: Login application
Steps: 1.Enter username, password
            2. Click on submit button.
and can add to any number of Test cases.
or other way using Keyword,

Test Script  name: Login Application
  Instead of steps use Keyword which has above mentioned steps 1 to 2.

I can apply either Test script or Keyword to attain modularity and reusablity.
If one can achieve then why Keyword functionality is brought in?

Can you give better example when we actually apply test script and keyword.

2 answers



permanent link
Subhajit Bhuiya (3541) | answered Dec 20 '18, 5:55 a.m.
JAZZ DEVELOPER

 It is recommended to use 1 test script per test case.

System can have 1000's of test scripts and test script it self can have many steps. Out of those steps, few group of step can be common in same as well as many test script. Create a test script with those steps and associate it with keyword. Now whenever you require those group of step in a test script, just reuse the keyword instead of writing them again. It is something like function in programming language.


Comments
vinitha dsouza commented Dec 20 '18, 8:18 a.m.
By mistake i selected this as correct answer. But i have few question,
i could even do this with Test Script. common related as one Test script and can add in other test cases. Why only Keywords?

vinitha dsouza commented Jan 03, 5:47 a.m.

Could you please answer above query


Subhajit Bhuiya commented Jan 07, 4:24 a.m.
JAZZ DEVELOPER

vinitha dsouza commented Jan 09, 8:16 a.m.
i have read this. But not able to decide what is better practise to apply.


permanent link
Bharath Rao (313) | answered Jan 11, 9:37 a.m.

Hi


Adding to the details shared by Subhajit, 

If you have a few common steps to be performed amongst other steps in multiple test script, you could use a keyword(as an alias) for the common steps.

If you have the same steps as described in a script, then simply associate it to the test cases.

Notice a subtle difference in the above use-cases.

Your answer


Register or to post your answer.