Web recorder doesn't add imports

Summary: Katalon doesn’t add import for keys when using enter in a textfield while/after recording, leaving you with code that doesn’t work until you add the import.

Operating System Windows 10

Katalon Studio Version 5.10.1

Browser and Browser version Chrome

Steps to reproduce
Be recording on any site.
Go To text field, enter text
press enter
make sure katalon records this enter and shows “keys.chord(keys.ENTER)”
end recording by clicking ok

Expected Behavior
It adds all the recorded behavior, including the needed imports

Actual Behavior
no import for keys.chord, so katalon throws in some code it cant process until you add the import

@jefBe it’s work OK in my side, look attached : http://prntscr.com/mbccag
Please send me your screenshot or log file or something needed to investigate.

added a screenshot of code used to test this, when the recorder adds “Keys.chord(Keys.ENTER)”, it doesn’t add 'import org.openqa.selenium.Keys as Keys", so if you try to run this afterwards, it fails with the following error.

Test Cases/test FAILED.
groovy.lang.MissingPropertyException: No such property: Keys for class: Script1548321116667
at test.run(test:22)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:319)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:298)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:290)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:224)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:106)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:97)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1548321869795.run(TempTestCase1548321869795.groovy:22)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.