Forum Discussion

sabereshcp's avatar
sabereshcp
Contributor
16 years ago

How to access the test suite properties in a script assertion

Hi ,

I would like to know whether can we access the test suite level properties created in the project in the "script assertion". If possible can you share the script to fetch the property value and for setting the property value of the test suite form the script assertion .


Thanks in advance,
Saberesh C P
  • AnandKiran's avatar
    AnandKiran
    Frequent Contributor
    Hi Sabersh,

    Try the below code

    def Count =    context.expand('${#TestSuite#Count}');

    and for setting a property

    testSuite.setPropertyValue("abc",value);

    Hope this helps  .

    Regards
    Anand.
  • Hi Anand,

    Thanks for your reply.

    But, I am only able to get the value from  testsuite property using the groovy script shared by you in "Script assertion" Step.

    If i try to set the value back using the script

    testSuite.setPropertyValue("abc",value);

    It gives an error saying there is "no such propety testsuite for the script"

    Can anyone let me know how to set the testsuite property value from the "Script assertion" Step.



    Thanks in Advance,

    Saberesh C P