Passing Global Variable between Mobile and Web automations within Suite and/or Collection

In my tests, I need to bounce between testing on an Android phone and verifying that same phone’s log as reported to a web server. But I have many phones contacting the same database (web server).

MOBILE

  • My app installs on Android phones A, B, C, … Z
  • The Katalon Mobile automation performs function X in my app.
  • The app reports when each phone has done function X to our server.

WEB

  • In a Katalon Web automation, I would like find the report for phone A, B, C or … Z
  • And validate that that particular phone reported to the server that X had been performed.

Then the Mobile app will do function Y, report to server; Web automation validates that Y was performed; continue to do function Z … et cetera …

I would like to pass the name of the phone (A, B, C …Z) from the Mobile test into the Web test so that the Web test knows which record to look at.

My problems are:

  • In a test Suite, it doesn’t look like I can bounce between Mobile and Web, but GlobalVariables are maintained within the suite (which is nice)

  • However, in a test Collection run “Sequentially”, as each suite runs, the GlobalVariable gets reset to default. So the name of the phone is lost

Because test Collection “Parallel” runs seem to cause conflicts on Android devices, it appears I need to run Collections in “Sequential” order. But that can take hours.

So I’ve spun up several VMs, each to run on different devices but accessing the same Katalon project (on a mapped harddrive). So having the Mobile test write to a file then having the Web test read from that same file would not work, since mulitple VMs may be accessing that same file at the same time.

Any ideas?

Well, the work-around I devised is to get the computer/VM’s hostname, use it as the name of a file to save to the common “Data Files” folder. The Mobile test will write the phone’s name to that file, then the Web test can read from that file. Since I’m running the Collection sequentially on each VM, this should work. But if ever I can run things in parallel on the same computer, it would be great if a Suite could bounce between Mobile and Web test cases.