Table of contents
1.
Introduction
2.
Develop the custom keywords plugin​
2.1.
Add the dependencies to the build.gradle file​
3.
Implement the custom keywords with a katalon-plugin.json file​
4.
Package the plugins with Gradle​
5.
Frequently Asked Questions
5.1.
Which language is used in Katalon?
5.2.
Which protocol is used by the RESTful Web services?
5.3.
What is the Katalon automation tool?
5.4.
What framework does Katalon use?
5.5.
Which WebDriver API is the fastest?
6.
Conclusion
Last Updated: Mar 27, 2024
Medium

How to develop Custom Keywords plugin in Katalon

Author Muskan Sharma
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Hey Readers!!

Do you know about the custom keywords plugin in Katalon?

The custom keywords plugin is known as the Katalon project, which contains some custom keywords implementations.

In this article, you'll learn how to develop a Custom Keywords plugin in Katalon.

Let's begin!!

How to develop Custom Keywords plugin in Katalon

Develop the custom keywords plugin

A Katalon Studio project with certain custom keywords implemented is referred to as a custom keywords plugin, and to develop the custom keywords plugin follow the steps given below :

Add the dependencies to the build.gradle file

To add your dependencies to the build.gradle file does as follows:

1. Go to File > New > Project, and select Generate to build.gradle file box.

New Project

  Given below is the Default build.gradle template is generated

 Default build.gradle template

2. Now Add the dependencies to the build.gradle file.

Enter the following code in the build.gradle file:For Gradle 7

plugins {
  id 'java-library'
  id 'groovy'
  id 'com.github.johnrengelman.shadow' version '7.1.2'
  id 'com.katalon.gradle-plugin' version '0.1.1'
}
repositories {
  mavenCentral()
}

def pluginSources = [
  'Keywords',
  'Test Listeners',
  'Include/scripts/groovy'
]


sourceSets {
   main {
    groovy {
      srcDirs = pluginSources
      srcDir 'Libs' // generated by Katalon Studio
    }
  }
}
shadowJar {
  exclude 'Temp*.class'
}
groovydoc {
  source = pluginSources
  docTitle = 'Zip Custom Keywords'
}


dependencies {
  implementation 'net.lingala.zip4j:zip4j:1.3.2'
}
Default build.gradle template

Implement the custom keywords with a katalon-plugin.json file

Add a katalon-plugin.json file with the following format to the Keywords folder:

{
  "keywords": [keywordClass1, keywordClass2]
}

Package the plugins with Gradle

1. Install Gradle.

2. Then in the command prompt, open the plugin project directory.

3. In the plugin project directory, run the following command.

gradle katalonCopyDependencies

4. In the Katalon Studio, Open the plugin project.

5. Run this command: 

gradle katalonPluginPackage 

in the Command Prompt, then check on the build/libs for the JAR package of the plugin.

Now let's look at the steps for testing and publishing the Custom Keywords plugin

  • Test the Custom Keywords plugin

A Katalon Studio project with certain custom keywords implemented is referred to as a custom keywords plugin.

Place the JAR package for the plugin in the Plugins folder of a new Katalon Studio project, and use the imported custom keywords, reopen the project. 

  • Publish the plugin to Katalon Store

Once your plugins are complete, upload them to the Katalon Store.

Frequently Asked Questions

Which language is used in Katalon?

Katalon Studio uses groovy language.

Which protocol is used by the RESTful Web services?

RESTful web services uses the HTTP protocol as a communication channel between the server and the client.

What is the Katalon automation tool?

Katalon is a modern, quality management platform that enables the teams of any size to produce the best digital experiences.

What framework does Katalon use?

Katlon used the hybrid test automation framework.

Which WebDriver API is the fastest?

The fastest and cheapest headless browser implementation for WebDriver is HTMLUnitDriver.

Conclusion

This blog has extensively discussed developing a Custom Keywords plugin in Katalon. We hope this article helped enhance your knowledge about Implementing your custom keywords with a katalon-plugin.json file , Testing the custom keywords plugin, and Testing the custom keywords plugin.

If you want to learn more deeply, check out the excellent content on the Coding Ninjas Website:

Auto-healing Smart XPath in KatalonDevelop a customized report plugin and generate groovy doc in katalon , How to resolve external dependencies for a plugin.

Refer to our guided paths on the Coding Ninjas Studio platform to learn more about DSA, DBMS, Competitive Programming, Python, Java, JavaScript, etc. 

Refer to the links problemstop 100 SQL problemsresources, and mock tests to enhance your knowledge.

For placement preparations, visit interview experiences and interview bundle.

Thank You

Do upvote our blog to help other ninjas grow. Happy Coding!

Live masterclass