Added the missing @RobotKeywordOverload. This annotation is needed to…#84
Added the missing @RobotKeywordOverload. This annotation is needed to…#84Hi-Fi merged 3 commits intoMarketSquare:developfrom
Conversation
… enable the overloading of the getElementByKeyword method in Robot Framework.
| "\r\n" + | ||
| "Passing attribute name as part of the locator was removed in SeleniumLibrary 3.2. The explicit attribute argument should be used instead.") | ||
| @ArgumentNames({ "locator", "attribute" }) | ||
| @ArgumentNames({ "locator", "attribute=None" }) |
There was a problem hiding this comment.
My approach:
@ArgumentNames({ "locator", "attribute=None" })
public String getElementAttribute(String locator, String... attribute) {
String attribute= robot.getParamsValue(attribute, 0, "None");
What do you think?
There was a problem hiding this comment.
I tried this but for some reason it wouldn't except both the version with 1 parameter and the version with 2 parameters that way. That would only work with just the String... params parameter.
There was a problem hiding this comment.
Ah wait, serves me right, trying to answer stuff like this without access to the code... See the fix below.
| public String getElementAttribute(String locator, String attribute) { | ||
| @ArgumentNames({ "locator", "attribute=None" }) | ||
| public String getElementAttribute(String locator, String... attribute) { | ||
| String attributeName= robot.getParamsValue(attribute, 0, "None"); |
There was a problem hiding this comment.
String attributeName = -formating
There was a problem hiding this comment.
What do you mean exactly?
There was a problem hiding this comment.
String attributeName = robot.getParamsValue(attribute, 0, "None");
______________________^
There was a problem hiding this comment.
ah found it, space between attributeName and = sign.
And fixed...
|
Can you give any indication when this will be available through mvncentral? |
Added the required annoation to enable the overloading. The only downside of this is that the parameter for the attribute name needs to have an =None declared or it won't work. It is a mandatory parameter though so...