-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add keywords to call methods from custom components #65
add keywords to call methods from custom components #65
Conversation
Looks good, but I'm a bit hesitant about creating different keywords for each different argument combination. I think calling with strings and booleans at least might be necessary in future. Couldnt we make this more generic and just make it "call component method" which takes *args and converts them automatically? Then we can use the argument converter from javalibcore (included in swinglibrary). https://github.com/robotframework/JavalibCore/blob/master/src/main/java/org/robotframework/javalib/reflection/ArgumentConverter.java I suppose we could just assume that there are no overloaded methods and that there will only be one method with specific name? Another approach would be that we try to choose the method with the same number of arguments as the call has. (But I'm happy with going with a simpler solution first, if that works for you). |
Also we really should have atleast some tests for this feature. |
Actually I was already thinking about it. Getting method with right number of arguments is not problem at all. I will update this PR soon. Making some tests based on existing test app should not be problem either. |
i have updated PR. Keyword now takes list of argument, and coverts them to required types. Only problem with this solution is when there are method overloads with same number of arguments (but different argument types). But i think this is quite rare case in real life. I Also added some tests. I'm not sure where getMethodByNameAndArgumentCount helper method should go. Any suggestion? |
This is very good. getMethodByNameAndArgumentCount helper can I think stay where it is until it is needed somewhere else. I think it would be slightly cleaner to add a helper private String getMethodDescription or something like that. But I can do that. |
add keywords to call methods from custom components
Hum, the documentation actually could have been improved. I already made a release, but I will improve the docs for next one. At least some examples would be nice. |
Right, totally forgot about it. I will take care of it if you don't mind. |
That should do it. |
We add generic getters which can be used to read data from custom controls.