Copy Test Steps - ATF

Mrman
Tera Guru

Hi All,

I know that we have a UI action on the Test called 'Copy Test' , we are able to copy the entire test along with test steps.

My Requirement is to copy individual test steps while creating test steps with out copying the entire test . Please let me know if we can copy .

5 REPLIES 5

Kevin Liao
Tera Expert

Hi Ravi,

 

This might not be exactly what you are looking for. I assume you are trying to copy an existing test step to another test?

If that is the case, what you could do is:

1. Uncheck the readonly check box on for the Test reference field on Test Step form

2. On your desired test step (since test is writable now), change it to the new test you need.

3. Click the "insert" ui action under the Test Step form's top left hamburger menu to copy this step to your new test

I would be cautious when doing this though, because if the step you are copying have reference to a previous step then that link would be broken.

 

Hope this helps,

Kevin

 

Hi Kevin and Ravi,

 

I don't know if that is what he was specifically asking. I will try to explain it (based on how I understood it).

 

When you are within a test, you have test steps.

 

Let's say I have the following test steps (I separated it into phases for illustration):

----- Setup

Impersonate

Create a record

set values

submit record.

------ Validate

query record

----- Modify

open record

set values.

update record.

----- Validate

query record.

----- Modify

open record

set values.

update record.

 

As you can see, The "Validate" and "Modify" sections could become pretty annoying to have to keep building out, esp if you are only modifying 1 or 2 fields. You could create a Test Template, but there are limitations (doesn't allow duplicates in it. ie Can only have "click a ui action", it only allows it on one table, and you still have to fill in all the data).

 

So ideally there is a solution where you can select a set of test steps, click "Copy test steps at the bottom" and it will create new test steps at the bottom and just increment the order execution.

 

Does that make sense? Has anyone created a solution like that?

Cecilia7
Kilo Contributor

What if we are trying to copy a test step in the same test without creating a reference?

For example, to approve an item, three test steps are needed:

1. Opening an existing record

2. Set Field Values (to set a state to approved)

3. Submit a form ( to save the change)

If an item needs to be approved multiple times in the same test, these three steps need to be created over and over again. It would be much easier to just copy and paste them within the same test.

I think a lot of ATF developers run into this and this is a feature that would help a lot of people.

reynaldemilien
Kilo Contributor

Use Test templates , it allows you to add a specific list of test steps into your test.

 

ServiceNow documentation - Test Templates