Commodore
Commodore
587 views

Setup Test to pass parameters between test cases

Hi All,

 

In SilkCentral, Execution Planning, and in any Execution Plan, Test Execution Setup, we can use Setup Test to setup the before condition of running a SilkTest test case.

We have the below in my execution plan.

 

This is my Setup test case.  We pass in the sUrl2 from SilkCentral into SilkTest and assign sUrl2 to sURL.  In the inc file, we have defined String sURL = "". 

We have the below test case that need to use the sURL parameter.

 

We create a Parameters sURL in SilkCentral, and we pass in a value as "http://test.com".  We can see that the sUrl is http://test.com in the setUp test case.  But it still fails for the login() test case, and the sUrl is blank.  We expect that the sUrl will populate to the http://test.com globally at setUp() and any subsequent test cases can use this parameter.  Is this a correct expectation?  Anyway we can populate the variable to use globally in setUp()?

 

Thank you for any suggestion!

0 Likes
1 Reply
Micro Focus Expert
Micro Focus Expert

Hi,

This value is not kept between two test executions.
Is it possible to pass the url as parameter like you do it in the "setUp" testcase?

Another workaround would be to store the value from the setUp testcase into a file and instead of using sUrl directly in the other testcases create a function that reads the value from the file.

Best Regards,
Sebastian
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.