How to Parallel testing on mobile and pc?

The Main will do the following:

  1. The Main retrieves a list of IDs of QRCodes from a local CSV file

  2. The Main iterates over the the list, repeats calling sub-test cases for each ID:

  • The qrcode_fetcher fetches an PNG image from database (in fact, a local folder)

  • The qrcode_processor process the QRCode image (in fact, print it.toString() to console)

This is just a skeletal implementation that demostrates how Test Cases in Katalon Studio can be structured. You should be able implement your own test scenario refering to this.

My current version of fetcher is:

import java.awt.image.BufferedImage
import java.nio.file.Path
import java.nio.file.Paths

import javax.imageio.ImageIO

import com.kms.katalon.core.configuration.RunConfiguration

Path projectDir = Paths.get(RunConfiguration.getProjectDir())
Path qrcodeDir = projectDir.resolve("Include/qrcodeImages")

// make sure the "id" is passed from the Main
assert id != null

Path image = qrcodeDir.resolve(id + ".png")
BufferedImage img = ImageIO.read(image.toFile())

return img

You should be able to extend the “fetcher” so that it talk to browser to fetch QRCode image from the database while utilizing “WebUI.*” keywords. If you can specify the URL to S3 bucket, the “fetcher” can get access to the storage immediately through AWS API, or AWS CLI through command line.

My current skeletal processor is:

import java.awt.image.BufferedImage

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

// make sure the id is given by the Main
assert qrcodeId != null

WebUI.comment("processing ${qrcodeId}")


// make sure the image is given by the Main
assert image != null

// make sure the image is an instance of BufferedImage
assert image instanceof BufferedImage

// you can do whatever you like 
Mobile.comment("${qrcodeId}: " + image.toString())

You should be able to extends the “processor” so that it sends the QRCode image into a Mobile device and let it consume as you like.

1 Like