I have some test cases that have over 400 objects, if I want to rename the test case or the folder where the objects are stored, Im losing linking and the test case will fail every time
I can re-record the test case or I can open the test case and add each object again but its very time consuming and makes portability of tests imposibile to run on a diff machine with diff folder structure.
QUESTION:
What is the fastest way to re-link a test case to folder with a set of objects that are only pertinent to that particular test case.
What version are you using ? It seems like a bug, since changes by refactoring test object and test case folders should be reflected in test cases and test suites. Does it not work consistently ?
Well I learned the hard way, renamed my test cases and re-sorted everything in folders and each test cases needed to have its own set of objects on different folders, didnt expect to lose the linking.
Yes, its consistent. how to replicate.
Begin a recording
Name/save test case
Create a folder, name it
Move newly created recording on that folder - Will break the linking
Create a folder, name it
Move newly created objects from repository on that folder (Still on root object repository folder) - Will break the linking
I`ve only used 7.7.0 after getting a license to this depth, I cant tell if older versions were having same issue. Thanks for confirming is a bug. Looking forward to see it fixed.
So mentioned approaches are the only available solutions ?
I found a way, its not easy but if you have to relink thousand of objects there is no other faster way.
TLDR; .groovy file type is where the path to the new object is stored, do a search for old location and replace with new location
Close Katalon studio.
Depending on you structured the folders where the test cases resides this will be different from user to user
Usually is:
C:\Users\USERNAME\git\TEST_FOLDER\Scripts
Inside that folder there will be a “Script_RANDOM_NUMBERS_.groovy”
Open the .groovy file with a text editor.
The content of the file is the same as when you open a test case in script mode, should look something like this
“WebUI.click(findTestObject(‘01_Images/input_Hide thumbnail title_file_contentthum’))”
For me “01_Images” is the subfolder where the objects reside
And “input_Hide thumbnail title_file_contentthum” is the object name
If you`re using windows, navigate to “01_images” and search for *.groovy
All scripts should appear on the search result.
Using a capable text editor, like notepad++, drag and drop all search results/script to your text editor.
Do a “search and replace” action, search for old folder location and replace with “01_Images”
Save everything. The new location should be updated and all objects should work as when was recorded.
provided you know exactly where and what what to replace, to automate the process you can use the sed tool.
although it is a linux native app, it is available for windows too: