robotframework / JavalibCore

Base for implementing Java test libraries to be used with Robot Framework
Other
42 stars 25 forks source link

Use case of Annotation library #20

Closed ndesai15 closed 4 years ago

ndesai15 commented 7 years ago

What is the main use case of Annotation library?

I can just find one use case. I can just make annotation in front of a method that this is robotkeyword. That doesn't make any sense at all as this external keyword library we are creating, already contains all the custom keywords for the testing. Then how annotation library is helping there?

I am having following structure in my class for using it. public class DocSample{

@RobotKeyword("This is a workflow user keyword")
public void workflow() {
System.out.println("Jay Bahuchar Mataji!!!Execution is done");
}

}

I thought statement we pass in a @RobotKeyword annotation will behave as a comment for my java doc documentation but it is not even doing that.

Do you guys have already implemented String[] getKeywordNames() method?

Hi-Fi commented 4 years ago

Annotation library is extremely helpful when having e.g. keywords with default values and/or wanting to be sure that argument names are easy to use (without compiling library with -parameters option that allows Reflection to get the parameter names).

Some more Dynamic API methods have been implemented at #24, but that getKeywordNames has been in library for a longer time.