I have 2 applications-Policy and Billing.
I have 2 Test suites-1 for Policy,1 for Billing.
I need the Policy Number Generated from Test Suite1(Policy) to be fed into Test Suite2(Billing).
Solutions tried:
1.Storing PolicyNumber into GlobalVariable.gPolicyNumber variable in Test Suite1 but then when trying to use the Global Variable into TestSuite2 it is not able to search the PolicyNumber in Billing.
Tried Writing the PolicyNumber field into an Excel in DataFiles section.
Problem: Although the Policy Number gets written in Excel,when the Test Suite 2 runs in sequential mode it picks the PolicyNumber of last Iteration and not the current updated Iteration.
Ex: Test Suite1 Iteration#1 PolicyNumber stored in Excel: ABC123
Test Suite1 Iteration#2 PolicyNumber stored in Excel: XYZ123
When the TestSuite2 runs in Iteration#2 it picks the old PolicyData from Iteration#1 and searches in Billing system.
Not sure what is wrong.
I understand that you want to reuse âthe Policy Numberâ in multiple Test Suites in a Test Suite Collection.
You chose a wrong path.
Two Test Suites in a TestSuiteCollection share nothing on memory. They can share only files on disk. TestSuiteA and TestSuiteB can not share anything on memory (e.g, a GlobalVariable value). So you should stop using Test Suite Collection. You should go for other ways of modularization.
Way 1: Test Cases in a Test Suite can share GlobalVariables
Let me assume a Test Suite includes 2 test cases, TestCase1 and TestCase2. So the TestCase1 can create a Policy Number and save it into a GlobalVariable.policyNumber; then the TestCase2 can refer to the GlobalVariable.policyNumber.
Way 2: Pass parameters via callTestCase() keyword
The callTestCase(calleeTestCase, params) keyword is more light-weight approach to share variable values. Your parent TestCaseC can call other Test Cases, TestCaseA and TestCaseB, while passing any value to the callees A and B. And a callee A can return any value to the caller TestCaseC.
You should be able to merge the Test Suite1 and the Test Suite2 into a single TestSuiteUnited, Then the TestSuiteUnited will work fine. The PolicyNumber in a GlobalVariable will be shared by all the test cases in the TestSuiteUnited.
This description suggests to me that you are dependent on the âData-Driven testingâ of Katalon Studio.
The âData-Driven Testingâ feature of Katalon is desinged with an assumption that the data source file (.xlsx, .csv) is given static. Katalon will load the file only once. Katallon will never reflesh its memory during a run. Katalon does not monitor any updates into the data source .xlsx file.
This seems to be a limitation that katalon is unable to render the latest generated test data in excel.
Also, i observed there is no option to modify the excel data directly in katalon.
Letâs say i have loaded the test data once.
Next Time i need to update some test data, i cannot do it from katalon UI. Instead i will have to modify the excel file and replace it with the existing one in data folder.
Thanks for the input @kazurayam.
The problem is there are different teams working on different modules. Policy Team creates their own module, Billing Team creates their own module. So we have different test suites prepared by different teams. That is the reason why i was going for test suite collection so that other team doesnât modify the test suite of other team.
Combining the test cases into one test suite would mean, i need to copy the Policy Team multiple testcases(20) every time i need to create a Billing Test Suite which could have been avoided if i took their complete test suite in a test suite collection.
OK. I understand that you have a good reason to use 2 Tes Suites; one for the Policy Team, anothe rfor the Billing Team.
However, as Katalon Studio is designed as such, 2 Test Suite can share nothing in memory. Taking this restriction given, you should review the design of your project.
I have a simple advice: You can create 2 folders in the Test Cases folder: like
I suppose that this way you can organize your test cases well. Isnât it enough?
Now let me go back the the original post where you wrote:
I donât undestand this explanation. So, I do not really see whatâs your problem yet.
What is âIteration#1â and âIteration#2â? The term âIterationâ is not defined in the Katalon terminologies, so you should clarify what âIterationâ means.
Iteration# is nothing but Round of execution.
Both the Test Suite#1 and Test Suite#2 runs sequentially as a suite collection for every round of execution.
So, in first round of execution of Test Suite#1(Policy System)-system generated Policy#: ABC123 and stored it in excel.
In Second round of execution of Test Suite#1(Policy System)-system generated Policy#: XYZ123 and stored it in excel.
Test Suite#2(Billing System) when it runs in second round, it picks the Policy#: ABC123 of Round1 insead of picking latest Policy#:XYZ123 from excel.
Among the following 3 cases, which is reailly the case?
Case A
You have a Test Suite Collection( TSC0) which binds Test Suite1 and Test Suite2 in the sequential mode. You execute the TSC0 twice. In this case, you will see
Test Suite1 runs in the first iteration
Test Suite2 runs in the first iteration
Test Suite1 runs in the second iteration
âŠ
CaseB
You do not use Test Suite Collection. You execute each TestSuites manually as âŠ
Test Suite1 runs
Test Suite2 runs
Test Suite1 runs in the second iteration
Test Suite2 runs in the second iteration
Case C
You do not use Test Suite Collection. You execute each TestSuites manually as âŠ
You are right. My Case is Case A.
The ideal case should be
4.Test Suite2 should pick Policy#XYZ123 but in contrary it is picking Policy#ABC123 generated in Iteration#1, donât know how from Excel.
If you just want to pass a string value from TestSuite#1 to TestSuite#2,
it would be much easier pass the data via local a JSON file.
TestSuite#1 writes a string into an ad-hoc JSON file, TestSuite#2 reads it
Creating, reading, writing JSON is easy. Far easier than working with Excel. See the following post:
However, I would still recommend you to merge your TestSuite#1 and TestSuite#2 into TestSuiteUnited where you use GlobalVariable to share the data as parameters. Thatâs the simplest and easiest.
I merged the 2 test suites. Although it was a tedious task, however i did it.
I used Global Variable for storing dynamic data and passed into Billing scripts. It is working as expected now. Thanks!
Will have to figure out why the excel latest data is not picked. Maybe try the excel steps in the merged test suite to see if it changes anything.
Just wanted to know will json file will be able to keep latest generated data or it will behave same as excel?