I'd like to copy the whole set of Variables of a Testcase to another

I’ve got a Testcase.

I copy the script and make some small adjustments.

Now I need all the variables of the previous testcase.

I would like to be able to copy them in script modus. then paste them and everything is arranged automatically.

2 Likes

Feel free to use GlobalVariables profiles in a sane manner and you can switch between a certain set of values in one click.

3 Likes

If you create your variables in your script or if you create them in the Variables tab, then just copy the whole Test Case, along with the variables, and then rename the Test Case. Then, ‘make some small adjustments’.

Otherwise, as @anon46315158 says, go with Global Variables that are “always” there.

Edit: if you have different environments to test in, you can put all the Global Variables in the Default profile and they will be available to all your profiles. As well, you can also create variables for each different environments if you need to overwrite the variables value, such as the URL, for the different environments. So, the Default profile will have the majority of your Global Variables and the other profiles will only need a smattering (few).

1 Like

wait… Copy test case ALONG with the variables…? you mean in 1 go?
how is that possible?

Single left click on your test case to highlight it. Then right click on your test case. Select Copy. Single left click on “Test Case” folder, then right click and choose, Paste. Then right click on your “new” test case (with Copy as part of the new file name) and then choose, Rename.

1 Like

@valentijn.peters
i hope you are trying to copy the test case inside the same project file
if yes
then instead of copying the scripts from the existing test case you can copy the whole test case and you can rename the test case.

by following the reply from @grylion54 I'd like to copy the whole set of Variables of a Testcase to another - #5 by grylion54

if you copy the test case, all the existing variables will be intact and you don’t need to re-create them as new.

Then u can make the needed changes to the script as well as to the variables in the variables tab.

if u still need to copy the variables alone in one go
if it is a local variable specific to a test case then

  1. open the test case
  2. open variables (Script mode)
  3. copy the whole and paste the whole into your new test case.

What was unclear was:

do the< ID >>'ss have to be unique? (for it to not cause any troubles in a later moment or somewhere else)
And we assumed the answer to that was : YES.

But now how you explain it the answer is probably: no the < ID >>'s do not have to be exclusively unique.

1 Like

It’s hard to explain sometimes what you mean right. Reading it back I didn’t explain it correctly.

I have a script1.
In that script a testcase (script2) is used.
That script(2) has Variables in it.

The script1 now needs all the right Variables… and since Script2 is used elsewhere…

now: that’s what I meant by: I want to copy all the variables.

I am looking for a solution of a smoother process of that. (faster and easier)

1 Like

If you are using variables across Test Cases within a Test Suite, then you should use Global Variables.

1 Like

To Avoid being caught in a similar Scenario. it is best practice to Use Global Variables.
as suggested by @grylion54

1 Like

I have to admit. ChatGPT helped me very well on this topic now. (although it also made some very basal mistakes :frowning: ) thanks for pointing in the right direction bharathi!!

1 Like

@valentijn.peters always welcome