Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes


Accepted answer

Permanent link
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

0 votes


2 other answers

Permanent link

 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.

0 votes

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

i have read this. But not able to decide what is better practise to apply.


Permanent link

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.

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,023

Question asked: Dec 20 '18, 1:22 a.m.

Question was seen: 2,408 times

Last updated: Jan 30 '19, 12:02 a.m.

Confirmation Cancel Confirm