Parameters other than Strings

Ask general questions here.
Mayra
Posts: 68
Joined: Mon Dec 16, 2013 5:27 am

Parameters other than Strings

Post by Mayra » Tue Feb 18, 2014 10:19 pm

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.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Parameters other than Strings

Post by krstcs » Tue Feb 18, 2014 10:59 pm

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.
Shortcuts usually aren't...

Mayra
Posts: 68
Joined: Mon Dec 16, 2013 5:27 am

Re: Parameters other than Strings

Post by Mayra » Wed Feb 19, 2014 12:03 am

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Parameters other than Strings

Post by Support Team » Mon Feb 24, 2014 6:12 pm

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