Why drag and drop doesn’t work in Custom Keyword section…??? Is there any possible reason. Please let us know.
In case, if drag and drop is not supported/allowed in Custom Keyword, please provide the possible workaround how to move customkeyword between packages in the most effective/ efficient ways.
I could confirm, drag and drop doesn’t work in the Keyword section.
I do not know the reason as I am not a Katalon developer.
I suppose that you already know it, but let me describe…
Assuming you have a package browser where you have a class file Advanced.groovy
and you want to move the Advanced class to a new package nuevo.
You create a new package nuevo manually
In the nuevo package, you create a new class file Advanced.groovy, which will be filled with a few lines of codes:
package nuevo
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.annotation.Keyword
import com.kms.katalon.core.checkpoint.Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.testcase.TestCase
import com.kms.katalon.core.testdata.TestData
import com.kms.katalon.core.testobject.TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable
public class Advanced {
}
You go back to the source file of the browser.Advanced class. You copy its code to the clipboard.
You go to the source of the nuevo.Advanced class. You paste stuff at the end of the source from the clipboard.
The nuevo.Advanced class will become syntactically wrong. You need to rewrite code to fix syntax errors.
save the nuevo.Advanced source.
remove the original browser.Advanced source.
You want to identify every references in the project to the original browser.Advanced class. These references are now causing error (No class definition found). You change all references so that they point to the new nuevo.Advanced.
I personally would not take this issue (in Keywords folder, moving a class accross packages is not supported) so seriously.
I do develop new Custom keywords quite some times. When I develop a new Custom keywords, I would at first write a unit-test using junit4ks for the Custom keyword class and always spend enough hours before writing a lot of dependent test case scripts. While doing unit-tests, I will think enough about the package name until I get comfortable about it. Therefore I would rarely need the “Refactoring” feature for Custom keywords to rewrite dependent test cases automatically.
I would rather hope Katalon Team to work on the other significant issues.
Katalon’s selling point is it’s ease of use, and it especially helps people with limited technical skill’s to use an automation tool with confidence. That being said… refactoring is a fundamental feature of any IDE that can’t be compromised.
I would request Katalon Team not to neglect these fundamental functionalities,
Thank you for reporting this issue. Unfortunately, now you can only refactor custom keywords in test cases, NOT in the Custom Keyword section. The enhancement of this feature will be released in the upcoming versions.