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.
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.
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.
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.