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.
Parameters other than Strings
Re: Parameters other than Strings
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.
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...
Re: Parameters other than Strings
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.
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.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Parameters other than Strings
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
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