Reusability - Test Script and Keyword
![]()
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.
|
Accepted answer
![]()
You can think of Keywords being a collection of test steps which is part of a bigger test script (containing other test steps).
An example can be the "preparation steps", before the steps which test the actual requirement intended to be tested by the Test Case. Such preparation steps can be grouped in a keyword, if the same preparation steps are also valid other Test scripts.
From your example, Consider 2 Test Cases. a) Check Account Balance b) Transfer Money.
You can define a keyword to login since it will be common steps for mostly all Test Cases
Test Case Name: "Check Account Balance - ABC Bank"
Test Script Name: "Check Account Balance"
1. Open URL - ABCBank.com
Keyword "Login":
1. Enter username, password
2. Click on submit button.
2. Click on view account Summary
Test Case Name: "Transfer Money - XYZ Bank"
Test Script Name: "Transfer Money"
1. Open URL - XYZBank.com
Keyword "Login":
1. Enter username, password
2. Click on submit button.
2. Click to view registered payees.
3. Initiate Transfer
vinitha dsouza selected this answer as the correct answer
|
2 other answers
![]() 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
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?
Could you please answer above query
Please read the RQM help doc related to keyword at https://jazz.net/help-dev/clm/index.jsp?topic=%2Fcom.ibm.rational.test.qm.doc%2Ftopics%2Ft_create_keyword_scripts.html
i have read this. But not able to decide what is better practise to apply.
|
![]() 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
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.