List of options for custom keywords

When you create a custom Keyword, is it possible to add a list of default values that can be used through the Manual test case screen? For example, I have the keyword below which will allow users to do something, but that something is limited to 2-5 actions, like : action1, action2, action3 etc.

@Keyword
	def foo(String list){

    println('Do something with ' + list)

	}

When the user adds the custom keyword through the Manual screen, can he choose these actions under ‘Input’ instead of having to type the values like in the scripting view?

Alternatively, if the above is not possible, how can one add ‘Descriptions’ to keywords so that when the user hovers over the keyword, you see an explanation, like with built in features and default methods?

1 Like
  /**
   * Set the specified row/cells to the specified values. The specified
   * cell is a constant.
   * @param cellId (String) e.g. <code>"txtDVSRESULT"</code> etc.
   * @param rows (List) e.g. ["0", "1", "5", ...]
   * @param values (List) e.g. ["10", "55", "-42", ...]
   * @param isAjax (boolean) Optional. If true, triggers autosave.
   */
  void setRowValuesByCell(String cellId, List rows, List values, boolean isAjax = false) {
    // stuff
  }
1 Like

Assuming option 1 is not possible: where would this code be place in my example?

@Keyword
def foo(String list){

println('Do something with ' + list)

}

/**
 * foo is a custom method that does something.
 * @param list (String) A list of things in a string.
 * @return This method returns nothing or something
 */
@Keyword
def foo(String list){
  println('Do something with ' + list)
}
1 Like

Oke this works in script view, but coming back to my initial question: how to get this in the manual steps view?
The goal is to make it accesible to non-coders.

I don’t think there is any way to do what you want to do. This…

'This is a description'
WebUI.comment("stuff")

places a description visible in Manual view, but that’s not what you’re asking for.

You could ask for UI hooks to be made available - post something to Suggestions.

1 Like

@Russ_Thomas i think the topic here is for the docstrings to be properly rendered in manual (and also script view intelicence) for custom keywords.
i noticed also that, even if i carefully format them, the engine will ignore it.

@ThanhTo @devalex88 it is an open issue on this matter? diacussions were a lot but i am not sure if you have this recorded on the dev board.

2 Likes

Thank you all - I’ve moved this topic to Feature Request.

2 Likes