Page 1 of 1

Parameters other than Strings

Posted: Tue Feb 18, 2014 10:19 pm
by Mayra
HI,
I have code modules than have bool or int as parameters.
I notice that when I try to add user code these methods don't get listed in the dropdow. Is there any way that I can use a type other than string for my test cases?
Thanks.

Re: Parameters other than Strings

Posted: Tue Feb 18, 2014 10:59 pm
by krstcs
Currently Ranorex only accepts string types as parameters for methods in the action table.

You will need to create a wrapper method that takes string versions of the values you want to test, then convert them to the type you want (bool.Parse(myVar), etc.).



My understanding (I could be wrong) is that they are looking at making it possible to pass other value types, but that it will be a very long way down the road if it happens at all.

Re: Parameters other than Strings

Posted: Wed Feb 19, 2014 12:03 am
by Mayra
OK, thanks for your response.

In order to avoid the wrapping, in which way can I code the TestSuite and the TestCases. I will code the test cases to call the methods that I need with objects, array, etc. DO you know of any examples?
Thanks.

Re: Parameters other than Strings

Posted: Mon Feb 24, 2014 6:12 pm
by Support Team
Hello Mayra,

As krstcs wrote user code actions only accept string types as parameters at the moment. There is already a feature request in order to add repository items to the user code action, but this is not so easy to achieve. It is not planned at the moment to support any other types except the string type.

Concerning your question how to code the TestCases and TestSuite on your own, unfortunately there are no examples how to do that because this is not recommended. You would have to use not documented API methods.

I would say creating wrapper methods is easier as writing you own TestSuite and TestCases.

Regards,
Bernhard