cancel
Showing results for 
Search instead for 
Did you mean: 

How can I programatically set (or write to) a "Properties" test step value?

SOLVED
sprice090161
Contributor

How can I programatically set (or write to) a "Properties" test step value?

I have already located the syntat to set a test cases custom property:

testRunner.testCase.setPropertyValue( "foo", bar )

 

This writes to the property defined under the "Custom Properties" tab, but I want to write to a property defined in the test cases local "Properties" test step.

 

Is this supported?

1 ACCEPTED SOLUTION

Accepted Solutions
HimanshuTayal
Community Hero

Re: How can I programatically set (or write to) a "Properties" test step value?

Hi @sprice090161 ,

 

If you are talking about Properties Test Step inside a Test Case, then you can use below syntax:

 

testRunner.testCase.getTestStepByName("Name of properties step").setPropertyValue("foo",bar);

If you are looking for something else then please elaborate.

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

5 REPLIES 5
nmrao
Community Hero

Re: How can I programatically set (or write to) a "Properties" test step value?

What's the use case?


Regards,
Rao.
HimanshuTayal
Community Hero

Re: How can I programatically set (or write to) a "Properties" test step value?

Hi @sprice090161 ,

 

If you are talking about Properties Test Step inside a Test Case, then you can use below syntax:

 

testRunner.testCase.getTestStepByName("Name of properties step").setPropertyValue("foo",bar);

If you are looking for something else then please elaborate.

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

sprice090161
Contributor

Re: How can I programatically set (or write to) a "Properties" test step value?

Perfect!

Yes, the test step, not the test cases properties. For that I had the syntax from the Tips/Tricks section.

 

Thank you

Satyadip28
New Contributor

Re: How can I programatically set (or write to) a "Properties" test step value?

testRunner.testCase.getTestStepByName("Name of properties step").setPropertyValue("foo","bar");
Iam doing the same using setPropertyValue to add Custom Property to TESTSTEP but it doesnt add atall.
This works when adding to TestCase or TestSuite but not to a TestStep.
ReadyAPI Version 2.5.0.

Can you please help.
HimanshuTayal
Community Hero

Re: How can I programatically set (or write to) a "Properties" test step value?

Hi @Satyadip28 ,

 

Can you please provide any screenshot ro error message that you are getting.

It wil be good it you start new thread as this is answered so that others can also help you.

 

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors