Katalon Studio version 6.1.2.rc2 with Settings support for custom keyword plugins


#1

Katalon Studio version 6.1.2.rc2 packages

https://s3.amazonaws.com/katalon/release-beta/6.1.2.rc2/Katalon+Studio.dmg
https://s3.amazonaws.com/katalon/release-beta/6.1.2.rc2/Katalon_Studio_Linux_64-6.1.2.tar.gz
https://s3.amazonaws.com/katalon/release-beta/6.1.2.rc2/Katalon_Studio_Windows_32-6.1.2.zip
https://s3.amazonaws.com/katalon/release-beta/6.1.2.rc2/Katalon_Studio_Windows_64-6.1.2.zip

Fixes and Improvements

  • Allowed users to disable auto-redirection for API test objects
  • Highlighted test steps that call markFailed
  • Fixed a bug that caused test cases to fail with status Reason: BUG! exception in phase 'semantic analysis' in source unit
  • Showed test case tags in HTML, CSV, and PDF reports
  • Added a tab to Search Dialog for searching test objects
  • Showed raw data of request and response when executing an API test object
  • Made Smart XPath plugin enabled by default
  • Fixed a bug that caused the last step to by marked as failed if any previous steps had failed
  • Fixed an issue of API testing where POST request JSON Body content is disappeared

Build custom keywords with Settings

With this new feature, a Settings page under Project Settings/Plugins can be created for a custom-keyword plugin. This can be utilized to store project-scoped variables for users to customize.

Add Settings page

Custom Keyword Plugin declares the setting page UI in katalon-plugin.json with this sample:

{
   "keywords": [],
   "configuration": {
      "settingId": "some id",
      "settingPage": {
         "name": "name",
         "components": [
            {
               "key": "key1",
               "type": "text",
               "label": "My Label 1",
	           "defaultValue":"My default value 1"
            },
            {
               "key": "key2",
               "type": "secret",
               "label": "My Label 2"
            }, ...
         ]
      }
   }
}
  • settingId: id the setting file that stores user setting properties in the setting page. There is a file will generated to store user settings at location:

    <Project dir>/settings/external/<settingId>.properties

  • settingPage : contains the following sub-properties

    • name: Name of the setting page
    • components: list of UI components
      • key: key of the component
      • label: label of the component
      • type: type of the component (‘text’ or ‘secret’)
      • defaultValue: default value of the component

Prepare to test

  1. Clone [https://github.com/katalon-studio/katalon-studio-excel-custom-keywords-plugin]

  2. Open the project in Katalon Studio at least once

  3. Modify katalon-plugin.json with this template

    {
       "keywords": ["com.katalon.plugin.keyword.excel.ExcelReadKeywords", "com.katalon.plugin.keyword.excel.ExcelWriteKeywords"],
       "configuration": {
          "settingId": "com.katalon.plugin.keyword.excel-keywords",
          "settingPage": {
             "name": "Excel Keywords",
             "components": [
                {
                   "key": "username",
                   "type": "text",
                   "label": "Username"
                },
                {
                   "key": "password",
                   "type": "secret",
                   "label": "Password"
                }
             ]
          }
       }
    }
    
  4. Build excel keyword project

    gradle katalonPluginPackage

    A jar file will be generated in /build/libs folder

  5. Copy and paste the generated jar file to Plugins folder of a Katalon Studio project (Project A)

  6. Open Project A and navigate to Project Settings/Plugins/Excel Keywords

  7. Customize the settings as wish

Retrieve the setting values

The values can be retrieved in keyword script as the following sample:

    import com.kms.katalon.core.configuration.RunConfiguration as RunConfiguration
    import com.kms.katalon.core.setting.BundleSettingStore as BundleSettingStore

    BundleSettingStore bundleSetting = new BundleSettingStore(RunConfiguration.getProjectDir(), '<setting_id>', 
    true)
    println(bundleSetting.getString('username', ''))
    println(bundleSetting.getString('password', '')

Reason: BUG! exception in phase 'semantic analysis' in source unit
How to Highlight Test object in each and every step
KeywordUtil.markFailed method
Last step counted as failed if some of previous step fails
Applitools integration
BUG! exception in phase ‘semantic analysis’ in source unit
#2

#3

hi @Dung_Ngo,

Thanks for this Bêta version.

At the stage :

gradle katalonPluginPackage

I have the following error:

/Users/USERNAME/Documents/MYKEYWORD/write.groovy: 24: unable to resolve class MobileBuiltInKeywords
@ line 24, column 1.
import MobileBuiltInKeywords as Mobile
^

/Users/USERNAME/Documents/KATALONPROJECT/Keywords/MYKEYWORD/write.groovy: 26: unable to resolve class WebUiBuiltInKeywords
@ line 26, column 1.
import WebUiBuiltInKeywords as WebUI
^

/Users/USERNAME/Documents/KATALONPROJECT/Keywords/MYKEYWORD/KEYWORD.groovy: 24: unable to resolve class WSBuiltInKeywords
@ line 24, column 1.
import WSBuiltInKeywords as WS
^

/Users/USERNAME/Documents/KATALONPROJECT/Keywords/MYKEYWORD/KEYWORD.groovy: 23: unable to resolve class MobileBuiltInKeywords
@ line 23, column 1.
import MobileBuiltInKeywords as Mobile
^

/Users/USERNAME/Documents/KATALONPROJECT/Keywords/MYKEYWORD/KEYWORD.groovy: 25: unable to resolve class WebUiBuiltInKeywords
@ line 25, column 1.
import WebUiBuiltInKeywords as WebUI
^

/Users/USERNAME/Documents/KATALONPROJECT/Keywords/MYKEYWORD/KEYWORD.groovy: 24: unable to resolve class WSBuiltInKeywords
@ line 24, column 1.
import WSBuiltInKeywords as WS
^

/Users/USERNAME/Documents/KATALONPROJECT/Keywords/MYKEYWORD/KEYWORD.groovy: 23: unable to resolve class MobileBuiltInKeywords
@ line 23, column 1.
import MobileBuiltInKeywords as Mobile
^

/Users/USERNAME/Documents/KATALONPROJECT/Keywords/MYKEYWORD/KEYWORD.groovy: 25: unable to resolve class WebUiBuiltInKeywords
@ line 25, column 1.
import WebUiBuiltInKeywords as WebUI
^

12 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:compileGroovy’.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2s
3 actionable tasks: 3 executed


#4

#5

@Dino, Please use Katalon Studio to open the project at least once so that necessary files are populated.


#6