Create a friendly name for custom keywords

Currently I have reasonably simple custom keywords, from a developer perspective, but would like to make these even simpler for non-developers to use and execute. For example, I have:

  • pages.Login.selectDefaultDepartment
  • menus.Menu.changeModule
  • wait.WaitEvents.waitForVisibilityOfButton

I would like to be able to give each of these a simple, higher level and friendly, keyword mapping like:

  • Select Default Department
  • Change Module
  • Wait for Visibility of Button

Essentially I’m looking to remove the package and class from the fully qualified custom keyword representation in a test case definition. These friendly names would live in a unique namespace, analogous to the Web UI Keywords namespace. The namespace could be called “Custom Keyword Friendly Names”, or something similar.

12 Likes

Hi Daryl

This has been requested before (well, something very simiar). I think the request was that once the Custom Keyword had been chosen from the dropdown it should not display the package name part and show only the right-most “friendly” part.

I tried searching for the post but failed to find it.

Anyway, I upvoted the suggestion – it’s a good one.

2 Likes

Anything new here? Good naming of keywords would really improve the perceived quality of Katalon Studio for non developers.

Thanks for the :heart:
:sunglasses:

That’s a very old post. Just a quick pointer…

If you don’t need to use “Manual View”, you don’t need to define your keywords like that. You don’t even need @Keyword. Just write them as static methods and import them where you need them.

Yes, I get that possibility. The question is: If we do need the manual view - how can we name keywords in a nicely human readable way, e.g. Click on cell in table instead of this.is.the.full.package.path.clickOnCellInTable? I would expect something simple like a title parameter of the keyword annotation like this:

@Keyword(title="Click on cell in table")
def clickOnCellInTable(int column, int row){
}

The test case script would of course have to contain some reference to the package path and so on, but this is just noise in the manual view.

I’ld like to also go around the method call statement, because it’s harder to read than what I described in the previous post.

I get it. However, due to a bug (bugs?) in Manual View, I never use it. That being the case, I’m not able to wade in and play around.

The bug…

This bug should not be of concern for this thread. Simply go around it and don’t create a class in the scripting mode, that should do it.

If my proposal would be accepted, this unique namespace would not be necessary. Simply add the title parameter to the keyword annotation and that namespace should not be relevant any more.