Need help with Execution Profile


#1

I can’t figure out how to use the Execution Profile functionality. I have different Profiles setup for Dev, Stage and Test Environments. I also have the default profile setup containing the hostname. I dont know what needs to go into navigateToUrl. Based on another discussion, I have this, but it’s not working:
WebUI.navigateToUrl(“http://${GlobalVariable.Hostname}/”)

When I execute this, it goes to Hostname, and it’s not using the GlobalVariable portion, which would take me to the individual environment that I need to go to, like, the Stage environment, which is what I have selected as the Execution Profile (in the upper right hand corner). Any help would be greatly appreciated! Thank you!


#2

It looks ok. If it can resolve that variable, the Hostname part of the variable will be in italics. Can you see that? I wouldn’t think this is a problem, but make sure you have the following import:

import internal.GlobalVariable as GlobalVariable


#3

Hi Nick, thanks so much for your reply. The Hostname part is in italics, and I do have that import listed, is there something else that I could have setup incorrectly? I resolves the Hostname portion, but not the GlobalVariable portion, and I have that defined as a Profile, and I have it selected in the upper right hand corner prior to executing the script… Thanks so much.
Tammy


#4

Tammy,

Please tell me what message you find in the log if you insert a line of WebUI.comment(…) as follows:

WebUI.navigateToUrl("http://${GlobalVariable.Hostname}/")
WebUI.comment("http://${GlobalVariable.Hostname}/)

#5

Tammy Ware said:

I can’t figure out how to use the Execution Profile functionality. I have different Profiles setup for Dev, Stage and Test Environments. I also have the default profile setup containing the hostname. I dont know what needs to go into navigateToUrl. Based on another discussion, I have this, but it’s not working:
WebUI.navigateToUrl(“http://${GlobalVariable.Hostname}/”)

When I execute this, it goes to Hostname, and it’s not using the GlobalVariable portion, which would take me to the individual environment that I need to go to, like, the Stage environment, which is what I have selected as the Execution Profile (in the upper right hand corner). Any help would be greatly appreciated! Thank you!

In your stage profile, what have you defined Hostname to be? Is it of type String?


#6

Thank you both for the replies, I really want to figure this out… Yes, for my Stage profile, it is defined as a String, is that correct? And the WebUi.comment came back with the Hostname portion only, so it’s just ignoring the Execution Profile that I am selecting (in the upper right hand corner of the display), which is the “GlobalVariable” portion, correct?
Thank you!


#7

Is anyone else having any problems with setting up Execution Profiles? Can someone provide an example of how they have it setup if it’s working? Any help would be greatly appreciated. Thanks! :slight_smile:


#8

Hi!
I’m also having problems. I have 2 profiles: default and profileA.
I have a variable (“pasta”) of type String defined in each of them, with different values. If I select profile default, everything works as planned, if I select profileA, in my code, I get the value null. :frowning:


Can you please help?
Thanks in advance!

null.png

profile.png


#9

Tammy and Mariana…

Tammy, from your description, it sounds like you’re trying to inherit some of the values from default and use them in Dev or Stage, etc. As far as I understand it, that is not going to work – I don’t believe you can do that. You need to create complete and separate profiles containing everything each execution profile needs.

I hope that helps but if I misunderstood, please explain again what you are actually doing.

Your idea though is something I have thought would be nice to have, that Katalon allowed a base profile which all profiles could “share”.

Mariana, since your Ingles profile (that’s “English”, right?) is so short, delete it from the profiles folder, copy the default profile and paste it into the profiles folder – Katalon will create a “default - Copy”. Now rename it to “Ingles”, then adjust the values inside it accordingly.

Hopefully, whatever weird thing was happening in there will be gone.

Let me know how that works out.


#10

Hi Russ!
Thank you very much!
Yes, Ingles means English in portuguese :slight_smile:
Your solution worked! :-)))


#11

Excellent. I’m glad B)

Portugal or Brazil?


#12

Still having trouble with my execution profiles, maybe I just dont have it setup correctly. I will attach a screenshot, but no matter what execution profile I have selected from the drop-down it runs what is listed in the “Navigate to Url”. In the screenshot, I want to run it on the Stage env, but it will run on test because that is what is selected for the Navigate to Url. What do I put as input to that command? Thanks so much!

Execution Profile.png


#13

Create two GlobalVariables BOTH CALLED “URL” – put one in Stage and the other in Test. Set the first to the Stage URL, the other to the Test URL.

In your Test Case use GlobalVariable.URL (not .test)


#14

Russ Thomas said:

Create two GlobalVariables BOTH CALLED “URL” – put one in Stage and the other in Test. Set the first to the Stage URL, the other to the Test URL.

In your Test Case use GlobalVariable.URL (not .test)

Thank you so much, Russ!!! This worked perfectly!


#15

Glad it worked for you, Tammy. And thanks for the BA B)


#16

I also facing the issue with the execution Profile.

  1. I have created two exicution profile like Profile1 and Profile2 . I have created two GlobalVariables in Profile1 (1. URL and 2. ProductName) and two different GlobalVariables in Profile2 (i.e 1.apiURL and 2.ConfigurableProductName) . Now in my TestCase named as TC1 , I want to access both profiles globalvariables . But when I used Profile2 globalVariable (i.e apiURL) then null value received on this.

Any solution on the above issue will be very helpfull.


#17

You can apply atmost 1 Execution Profile for a single execution of a Test Suite.
You can not apply 2 or more Execution Profiles for a single execution of a Test Suite.

So what you can do? Merge your Profile1 and Profile2 into Profile0, and apply Profile0 to your Test Suite.


#18

Okay, but it will increase my single execution profile length and also mixed up the variables in terms of their categories.

For example I have 50 GlobalVariable in Profile1(This profile is for some specific category variables) and 100 GlobalVariable in Profile2 (This profile is for some other specific category variables) . If I merged this Profile1 and Profile2 into the single profile0 then now my single profile contains 150 GlobalVariables with mix of categories.


#19

Execution Profile is just one of the ways of passing parameter values to test suites. Katalon Studio provides other various ways.

Combination of Execution Profile and other methods would make your life easier.

One Profile for one test suite execution. This is the given.

If you have many parameters and several categories, you should consider saving them in JSON files per category rather than storing them in an Execution Profile. You would want to write some metadata (which JSON files to load on test suite startup) in the Execution Profile. Your TestListener @BeforeTestSuite code can load as many JSON files as you would like.


#20

Pay attention. This is Gold.