I am looking for ways that i can duplicate my test cases so that similiar processes can be automated easily, help me out.
I don’t understand your question.
Please describe what you have tried and failed. That story would best describe your idea.
How similar are the processes? If all the steps could be reused, or even just some of the steps, you could create a ‘shared’ test case perhaps?
Then use ‘Call Test Case’:
for example I have testcase called testcase a, i want these same steps in testcase b, so like we do in chrome tabs is there a way to duplicate the testcase a, so i will have a testcase with same steps to modify the testcases and reuse it again
Copy and paste?
Hi @Shakkir, As Dan said Copy and Paste would be the way to create duplicate test cases…
But you could also use the same test case(s) by using different Profiles…
- See this posting: Execution profile | Katalon Docs.
- You can find some good videos here: how to use profiles in katalon studio - Google Search
If you want an exact duplicate, you can also have the TC you want as a “called” test case, like:
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject WebUI.callTestCase(findTestCase('Miscellaneous/myMainTestPlan'), [:], FailureHandling.OPTIONAL)
You can also set up the Test Case with variables that you pass as a list if you want a tiny bit of change:
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject WebUI.callTestCase(findTestCase('Miscellaneous/myAuthors'), ['ProgArea':'AdultSection','AuthorKey':'Agatha Cristie'], FailureHandling.OPTIONAL)
and in the Test Case, you would have variables accept the “ProgArea” and “AuthorKey” (etc, etc) that are passed in.
Edit: If you plan on passing a lot of variables, then I would not do it this way. Then I might create a group of either static variables or Global Variables and go that way.
how to copy paste a whole testcase ?!
Do not need to copy and paste, just add same test cases into different testsuite.
@Shakkir -There are many solution as already discussed by other users in the above thread, but follow easiest method as per you convenience.
Copying and pasting a test case could be the simplest way to achieve your objective, although only you know how much duplication there really is and you could end up maintaining lots of scripts, rather than one ‘common’ script. There are lots of links and ideas on this thread and note that one of the principles of development is Don’t Repeat Yourself.
Anyway… to copy and paste a test case or any other item, just use Test Explorer view, right-click a test case and copy, then paste it to same folder or different folder, as you might expect a Windows app to behave.
To have your entire code highlighted in order to be copied, hit the combo keys CTRL + A. Then to copy, use CTRL + C. And to paste, use CTRL + V.
Additionally, as @Dan_Bown states. you can copy and paste right in Test Explorer. Select the Test Case, right click and select copy, then move up to the folder and right click on it and select paste. Then you can right click on the “new” file and select Rename.
mhm … right click on the relevant ‘folder’ in Katalon?