Passing value from one test case to another

Best practices, code snippets for common functionality, examples, and guidelines.
ankit26
Posts: 5
Joined: Thu Jun 16, 2016 11:35 am

Passing value from one test case to another

Post by ankit26 » Wed Aug 10, 2016 11:27 am

I want to pass the value of a variable from one test case to another test case. Can someone please help me with the same.I am using Ranorex 6 on desktop.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3908
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Passing value from one test case to another

Post by odklizec » Wed Aug 10, 2016 11:44 am

Hi,

Please check this blog about passing data from one module to another:
http://www.ranorex.com/blog/sharing-dat ... o-another/
You can use the same principle for transferring value between test cases, using Global Parameter to which you can save a value from Test Case A and then read that Global Parameter in Test Case B. Hope this helps?
Pavel Kudrys
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

ankit26
Posts: 5
Joined: Thu Jun 16, 2016 11:35 am

Re: Passing value from one test case to another

Post by ankit26 » Thu Aug 11, 2016 1:25 pm

I forgot to mention that I have multiple test cases in one test case and I am not able to pass the value. When I open Global parameter and add a name but it does not have any module variables under the dropdown. I have been using global variables for passing values between modules but am not able use the same concept for passing the values between test-cases.

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

Re: Passing value from one test case to another

Post by krstcs » Thu Aug 11, 2016 2:15 pm

Actually it is exactly the same. Create a global parameter, set the value in module A in test case 1, and read the value in module B in test case 2.

The binding of global parameters happens at the TEST CASE level, not at the test suite level, so you won't see binding up in the global parameters list, but you can bind them when you go to the test case's data binding dialog.

I would highly recommend reading the user guide completely as it covers all of this in detail. http://www.ranorex.com/support/user-guide-20.html
Shortcuts usually aren't...