Query about Execution Profiles

Hello Team,

Because of the IT policy in an organization where I am working the test environment sites which I am testing can be only accessed by entering a password. To execute test cases on these test environment sites all of my Test Cases start with steps to enter the password and then doing the normal test operation. Every test script I have contains these steps. Because of these steps, I am not able to run the same test script on the Prod environments which are not hidden under password. I was wondering if there is an ability in Katalon to dynamically set within the Execution Profile is “TEST1” or “TEST2” execute these steps first else just execute normal test script?

Sample test Steps :

Step 1 : WebUI.openBrowser(’’)

Step 2 : WebUI.maximizeWindow()

Step 3 : WebUI.navigateToUrl(GlobalVariable.URL_ADMIN) /Going to Admin URL/

Step 4 : WebUI.setText(findTestObject(‘Shop_Login_Page/Password_Field’), GlobalVariable.Pass) /Entering Password, There is no username here/

Step 5 : WebUI.click(findTestObject(‘Shop_Login_Page/Enter_Button’)) /Clicking on Enter button/

Step 6 : WebUI.navigateToUrl(GlobalVariable.URL_DIRECT_PRODUCT) /*Now going to the Test URL where the testing will be performed */

From Step 1 to Step 5 the script is basically authenticating itself on the test environment and from Step 6 it is going to do test execution.

Sure, should be easy, we do something similar. We’ve created one profile for each environment we test, and each profile contains different credentials to log into that instance of the app. You can do something quite similar in the case that there’s NO password. Set up the profile for your each of your environments like this:

image

Be sure to set the type to boolean for the ‘isPasswordProtected’ variable:

image

Then your script could look like:

WebUI.openBrowser(GlobalVariable.URL_ADMIN);

if(GlobalVariable.isPasswordProtected) {
    WebUI.setText(findTestObject(‘Shop_Login_Page/Password_Field’), GlobalVariable.Pass);
}
1 Like

Thanks @Brandon_Hein for your quick reply. We too have different profiles for different environments as they have different URL’s and Password. I will try to use your solution right now.

@Brandon_Hein I just tried the solution you shared and it is working as per our requirements.

Thanks for your help again.

2 Likes