Editing Parameter via user code

Ranorex Studio, Spy, Recorder, and Driver.
Rvik
Posts: 1
Joined: Thu Feb 25, 2016 3:12 pm
Location: Kraków, Poland

Editing Parameter via user code

Post by Rvik » Tue Mar 01, 2016 6:18 pm

Hi,

I wanna ask if it is possible to edit Parameter via User Code?

Let me give you an example to explain it to you what I want to achieve.

I have test case A.

In this test case I have a module A where I get a value A which is bound to other modules via parameter A.

I have also module B, where I wanna use modified parameter A. I wanna modify it via user code.
For Example:
Value A = 'View 11' and I want to make it 'View 12'
Making 12 from 11 is easy by code, but my question is: How can I modify parameter A via user code (bind parameter A to user code).

If it's possible, my question is how can I achieve it in C#?

P.S. I'm not asking for an another solution for this particular example, but I'm asking about modifying Parameter via user code.

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

Re: Editing Parameter via user code

Post by odklizec » Wed Mar 02, 2016 8:23 am

Hi,

You can modify Parameters via code like this:
for Test Suite parameters:

Code: Select all

TestSuite.Current.Parameters["ParameterName"] = stringVariable;
for current Test Case parameters:

Code: Select all

TestCase.Current.Parameters["ParameterName"] = stringVariable;
or like this for Test Case via its name:

Code: Select all

TestSuite.Current.GetTestCase("TestCaseName").Parameters["ParameterName"] = stringVariable;
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