Hello,
Created Two array list global Variables
arraylist1
arraylist2
In test case 1 I get arraylist1 as an output
In test case 2 I get arraylist2 as an output
I created a test suite collection to run the both of them Then use a Test case 3 Which is a compare function that takes Arraylist1 and Arraylist2 as inputs and compare them
My problem is:
Both array lists are empty in TestCase3 so when i print them or compare them they say that i have two empty lists even though i ran TC1 and TC2 before TC3
I tried it in a sequential and parallel way apparently it doesn’t work both ways
the arrays are not empty in their individual test case
is there a way that i can get the outputs from the others tezt cases into the third one so i can compare them
The test suite is techincally a test case
Test suite 1= Login test case+ Function testcase (Gets me array list 1)
Test suite 2 = Login2 test case+ Fucntion2 test case (Gets me array list 2)
Test suite 3 = compare function (Compares array list1 and array list 2 )
Test suite collection = Test Suite 1 + Test suite 2 + Test suite 3
An instance of GlobelVariable is scoped within a “Test Suite”.
2 Test Cases in 1 Test Suite can share a GlobalVariable’s value.
2 Test Suites can not share a GlobalVaraible’s value.
If you want to keep 3 Test Suites in a Test Suite Collection and share information, then GlobalVariable is not suitable. You should save & load data in a file.
@GIO The way to structure your TC is create a Test Suite that ONLY runs TC3. Inside TC3, set both Global Variables to empty, then CALL TC1 (this will fill your first Global Variable), then right afterwards, CALL TC2 (this will fill your second Global Variable) and then you have the comparison code of TC3.
GlobalVariable.gArrayOne = []
GlobalVariable.gArrayTwo = []
WebUI.callTestCase(findTestCase('path to TC1', [:], FailureHandling.OPTIONAL))
WebUI.delay(1)
WebUI.callTestCase(findTestCase('path to TC2', [:], FailureHandling.OPTIONAL))
WebUI.delay(1)
"now compare gArrayOne to gArrayTwo"
blah blah blah
If you don’t do it something like this, then you should look into another method, like saving your references and not Global Variables.
This is the path you mentioned
if it isnt like that is there a way i can get the Test Case path ?
““GlobalVariable.gArrayOne = WebUI.callTestCase(WebUI.findTestCase(‘path to TC1’), [:], FailureHandling.OPTIONAL))””