display variables in variables

Best practices, code snippets for common functionality, examples, and guidelines.
maamer
Posts: 13
Joined: Fri Nov 30, 2018 6:03 pm

display variables in variables

Post by maamer » Fri Nov 30, 2018 6:08 pm

hello,
iam new to this technology, iam trying to store the web elements in variables and display them in the report . how do i do it?
Attachments
report.png
report output
report.png (9.17 KiB) Viewed 44 times
repo.png
my code
repo.png (35.62 KiB) Viewed 44 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11720
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: display variables in variables

Post by Support Team » Fri Nov 30, 2018 9:23 pm

Hi Maamer,

I will be happy to assist you with this issue. From the looks of it, you are doing things the hard way (which will also require higher maintenance over time). It is recommended to only go into code if needed. 95% of the time, you can do everything in a simple recording module (which has a ton of benefits over using custom code). A recording module is just beautified code with a lot of enhancements and you can always view/edit the code in a recording module if needed. I highly recommend going through our various resources linked below if you have not done so already and try to create your test cases in standard recording modules. If you have any trouble with this, please let us know as we will be happy to help. Nonetheless, if you wish to continue with your code, continue reading. Currently, you only have the element itself, hence why the report is printing [Ranorex.Core.Element]. You must get the attribute value of the card_Bal element. To get the attribute value, you can use the following method. I hope this helps!

Cheers,
Ned
.
Image