Static variable in a testsuite

How can I create and use a static variable from my own class in a testsuite? I need it to be available for all testsuite test cases.

1 Like

A GlobalVariable is accessible for all test cases that comprises a testsuite. A GlobalVariable is testsuite scoped.

Your test case can update the value of a GlobalVariable runtime. However, please note that the update to a GlobalVariable is NOT persisted into Execution Profiles on the local disk.

Do you want to share a value amongst 2 or more Test Suite? — There is no such built-in feature. You have to develop you own code that persists values via files. You want to write a value into a file in TestSuite X, and TestSuite Y reads the value out of the file.

  1. Please use the Global Variable
  2. if you need to add some more can define the same under the Test Listner @BeforeTestSuite
    @BeforeTestSuite will execute before a test suite execution begins (mostly used to set some Pre-requsites for a test suite under this)

1 Like