Forum Discussion

TesterNo1's avatar
TesterNo1
Contributor
10 years ago
Solved

Unable to set poperty from set up script in test suite level

testRunner.testCase.testSuite.setPropertyValue("BuildNumber",unixtimeStamp)

Hi all,

 

I am unable to set poperty from set up script in test suite level but same code works from groovy step in the test cases.

 

Is there any way to set up properties at test suite level from set up script ?

 

Thanks you.

 

  • If it is testSuite setup script, then below should work:
    testSuite.setPropertyValue(name, value)
  • nmrao's avatar
    nmrao
    Icon for Champion Level 2 rankChampion Level 2
    If it is testSuite setup script, then below should work:
    testSuite.setPropertyValue(name, value)
    • TesterNo1's avatar
      TesterNo1
      Contributor

      Thank you Rao for quick turn around.it really helped.

       

      I am clueless as to why syntax is different.

      • nmrao's avatar
        nmrao
        Icon for Champion Level 2 rankChampion Level 2
        When you open the testSuite setup script, you should be able to see on the top of the editor that the available object names like runner, context, testSuite, log in this case. Only those will be available.
        Similarly, different objects available at different levels like groovy script test step, script assertion, project load script, and teardown scripts.