Page 1 of 1

Editing Parameter via user code

Posted: Tue Mar 01, 2016 6:18 pm
by Rvik
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.

Re: Editing Parameter via user code

Posted: Wed Mar 02, 2016 8:23 am
by odklizec
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? ;)