*** Why drag and drop doesn't work in Custom Keyword Keyword ***


#1

Hi Katalon team, @devalex88 , @ThanhTo @kazurayam @Russ_Thomas

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.

Thanks team for looking into this.


#2

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…

  1. Assuming you have a package browser where you have a class file Advanced.groovy
  2. and you want to move the Advanced class to a new package nuevo.
  3. You create a new package nuevo manually
  4. 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 {
}
  1. You go back to the source file of the browser.Advanced class. You copy its code to the clipboard.
  2. You go to the source of the nuevo.Advanced class. You paste stuff at the end of the source from the clipboard.
  3. The nuevo.Advanced class will become syntactically wrong. You need to rewrite code to fix syntax errors.
  4. save the nuevo.Advanced source.
  5. remove the original browser.Advanced source.
  6. 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.
  7. done

#3

Thanks @kazurayam for explaining it in detail.

@devalex88 @Trong_Bui @ThanhTo @Katalon_Studio @Vinh_Nguyen @Russ_Thomas

Hi Katalon DEV Team, could you please tell why drag and drop doesn’t work for Custom Keywords.

It’s a very big paint point., since handling it manually is painstaking , time consuming and error-prone. Please respond. Thanks.


#4

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.


#5

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,


#6

Thank you for the suggestion. We will add this to 6.4.0’s backlog.


#7

Thanks @devalex88

Katalon 7.0 is on it way … Can we expect it during that release?


#8

Please check the 7.0 beta version for this feature.


#9

Thanks @devalex88 I tried the drag and drop in 7.0 beta …with the sample project and faced issue.

Steps to reproduce:

  1. Created a package named complex.
  2. Drag and dropped the ‘Login.groovy’ from simple to complex package as shown in the below image.
  3. Ran the TC : Order and check out a single product, which failed due to issue in ‘shop.groovy’ keyword in simple package.


Custom Keywords Refactoring
#10

Hello @focis.automation

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.

Cheers

Jass


#12

Hi there,

Now you can refactor custom keywords in both test cases and the Custom Keyword section with Katalon Studio 7.1+.

Katalon Studio 7.1 will be available soon. Read more about its release note.

Jass