Hi Team,
I developed a user code collection class in which i created a method called
"public static decimal ConvertStringToDecimal(String param)" to convert fetched values from String to Decimal so that i can perform calculations over it. But the issue comes when accessing this method from Recording Module.
When I add this method using Add Action->From User Code Library, How can i get this value under some variable because there is no way i can this access the return value. There is a field called arguement(where i pass the string) but there is nothing where i can get this value.
Can you tell me the way to use this method under recording value and fetch its output in some variable?
Regards
Neeraj Negi
How to use reusable code that provides output in Recording
-
- Posts: 2
- Joined: Mon Jan 15, 2018 7:22 am
Re: How to use reusable code that provides output in Recording
Hi,
You need to create a new Recording module variable, which you can access from the user code.
These two blog posts should help you with details:
https://www.ranorex.com/blog/custom-smart-actions/
https://www.ranorex.com/blog/sharing-da ... o-another/
You need to create a new Recording module variable, which you can access from the user code.
These two blog posts should help you with details:
https://www.ranorex.com/blog/custom-smart-actions/
https://www.ranorex.com/blog/sharing-da ... o-another/
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 2
- Joined: Mon Jan 15, 2018 7:22 am
Re: How to use reusable code that provides output in Recording
Hi,
Thanks for acknowledging but you guys misunderstood my query.
I am attaching the screenshots as well.
Query: I develop a user code method which I changed to 'public static Decimal XYZ(String s)' instead of 'public static void'.
So now, my user code method takes String value and return decimal value as it is not a void method.
Now when I use this method in my recording module using Add New Action->User Code->Select From Library. I did not find anything where I can retrieve this decimal value which is coming as output of this user code action.
Through Code Module, it is possible but my question is regarding the Recording Module.
PFA the screenshots for better understanding.
Thanks for acknowledging but you guys misunderstood my query.
I am attaching the screenshots as well.
Query: I develop a user code method which I changed to 'public static Decimal XYZ(String s)' instead of 'public static void'.
So now, my user code method takes String value and return decimal value as it is not a void method.
Now when I use this method in my recording module using Add New Action->User Code->Select From Library. I did not find anything where I can retrieve this decimal value which is coming as output of this user code action.
Through Code Module, it is possible but my question is regarding the Recording Module.
PFA the screenshots for better understanding.
You do not have the required permissions to view the files attached to this post.
Re: How to use reusable code that provides output in Recording
The Decimal class has a Parse(string input) method that does this already, why re-invent the wheel, so-to-speak?
decimal value = Decimal.Parse(string input);
https://msdn.microsoft.com/en-us/librar ... .110).aspx
decimal value = Decimal.Parse(string input);
https://msdn.microsoft.com/en-us/librar ... .110).aspx
Shortcuts usually aren't...