Is there a way or course of action to test the mobile version of the app?
the case is like this: “I want to run the test in v1.1 with step A, and if version is v2.0 I want to run the test with step B”
is there a way for this, with installed app version parameters?
then there is no need to refer the app version to be validated and execute the test script
if you have a scenario like that then please proceed with the updated apk alone and keep the script designed for v1.1 for testing backward compatibility.
for you case please do a smoke test on both the applications and check there is any mentioning of apk version inside the application
if there is any fetch the version from the application and use if(condition){} else {} and based on the text in the version you can proceed to do your execution.
ios (xcuitest) does not expose versionName through the driver, so read it from the ipa before the run: unzip -p app.ipa 'Payload/*.app/Info.plist' | plutil -extract CFBundleShortVersionString raw -o - - and pass it in as a GlobalVariable, or ask the app to show it in a settings screen you can getText from.
to keep the test cases clean i would wrap the two flows in callTestCase and keep the version check in one place (a listener that sets GlobalVariable.appVersion in @BeforeTestSuite), so individual test cases just check the global.
Even before run time as well you can get the details, so there are 2 options to get the details
Option 1: Read the installed version at runtime (Android) ( already shared by Depa)
Option 2: Read the version from the build file (Android and iOS), find the details below
Read it before the run and pass it in as a Global Variable:
Then pass it in through your execution profile or the Katalon CLI (-g_appVersion="2.0"). Since you already know which build you’re installing, this avoids relying on driver capabilities and works the same on both platforms.