I want to create multiple projects in katalon and share a common set of listeners and custom keywords across all these projects. Is this possible?
HI Im running into this problem too. Did you find a way of doing it? if yes please kindly share. Thank you
As for TestListeners, I think there is no way to share them other than manually ‘copy&pasting’ the source. Therefore you should make the listeners’ code as short as possible. If you need many lines to execute in a TestListener, you should make a Groovy class which encapsulates the required lines, and your listeners call methods of the class. The class would be located in the
Keywords directory or in an external jar.
As for custom keywords, there are some possibilities, but unfortunately they are not straight forward.
- Katalon Studio provides a feature named Import/Export Keyword. It works to some extent but I am not happy with it. See "Import Keywords from Git" is behaving wrongly for my opinion.
- Some people said they want to create a jar file which contains the binary of their custom keywords developed in a Katalon Studio project. For example, see Is there any way to share test listeners and custom keywords code to multiple projects? . Unfortunately the method has not been developed yet.
- I have an idea in my mind that it would be possible to make a jar file of custom keywords using Gradle build tool inside a Katalon Studio project. Have a look at my comment How to define Global Variables within Scripts, i.e. "on the fly"? . But I have not yet worked out for it.
Thank you kazurayam!!
This sounds good to me. But are you also planning to include the Test Listeners?
And the result of this task will be a plugin that someone can install into his own Katalon Studio project or simply a jar file?
@devalex88 recently gave the answer to my above question in another discussion: