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
Remote library calling run_keyword provides object as string representation #4874
Comments
Just for insight, this is our remote library interface implementation for run_keyword for the XmlRpcService: public XmlRpcStruct run_keyword(string friendlyName, object[] args)
{
// I directly checked the values of args here, before anything was done
Logger.Debug($"XmlRpc method call - run_keyword: {friendlyName} with args [{string.Join(",", args)}]");
XmlRpcStruct xmlRpc;
try
{
var typename = _threadKeywordType[Thread.CurrentThread.ManagedThreadId];
var keyword = _keywordManager.GetKeyword(typename, friendlyName);
// Pre-process arguments for conversion of arrays to lists/dictionaries (SupportedTypes)
args = PreProcess(keyword.KeywordMethod, args);
var result = _keywordManager.RunKeyword(keyword, args);
result.KeywordReturn = PostProcess(keyword.KeywordMethod, result.KeywordReturn);
Logger.Debug(result.ToString());
xmlRpc = XmlRpcBuilder.FromKeywordResult(result);
}
catch (Exception e)
{
Logger.Error($"Exception in method - run_keyword {friendlyName}: {e.Message}\n{e.StackTrace}");
throw new XmlRpcFaultException(1, e.Message);
}
return xmlRpc;
} |
I have noticed this error occurs on my remote server implementation, due to the types that are provided to the robot framework in the library information. For dictionaries and lists of specific type other than It also explains the difference in my comparison, since in my own simple xml-rpc client in python, there was no argument conversion and no request for library information. I simply called the keyword directly. Some details about this can be seen in the slack-conversation: Also, my forum post will be solved by closing this issue: I'm closing the ticket as it has been resolved. |
I have a remote library using our own Remote Library Interface implementation in C#.
Given a testcase like this:
Then the provided argument
${LIST_INT32}
will be passed as a string representation of the object, in our case:"[1, 2, 3]"
I would expect that robot framework calling
run_keyword()
would provide such variables as-is, which is also the case according to the documentation:I am unsure why the invocation in the code of Remote.py does this.
I've done a very simple comparison using the XML-RPC client of python directly:
This simple comparison provides the object as-is and doesn't convert the object to a string representation.
It's the same keyword being called.
I've set a breakpoint in my XmlRpcService.
Calling the keyword from my simple xml-rpc client in python, I can see the argument provided as this:
When the keyword is called through robot framework with the scalar variable, I can see the argument provided as this:
In my eyes, this is a bug in robot framework, as somehow in the Remote library implementation the testcase variable is not provided as-is.
You can see that I've used an asterisk in this invocation, to provide the argument list as-is.
This should be equal/similar to the implementation of Remote.py:
I am unsure what is done differently to the argument list in robot framework.
The text was updated successfully, but these errors were encountered: