Can't get the latest value of the global variables when generating reports

Hi @duyluong @Jass and all,
As https://docs.katalon.com/katalon-studio/docs/execution-settings.html#client-certificate-settings described, in the latest Katalon, which version is 8.3.0, we have the ability to refer and show the GlobaleVariable value in the report’s topic and body.
However, when testing, I found those variables can be shown but always with the default value, under the Studio mode.
The steps are rough as below:

  1. set up the project settings, edit the test suite template, and introduce the global variable in the subject and body.
  2. create a global variable, and set up a default value, for example, 1.
  3. create a test case and package it in a test suit, do something, and set the global variable value to 2.
  4. run the test suite. Once finished, I can receive a mail. We can see that the shown global variable value is 1, not 2.

hi @shawn.shen,

I am one user of Katalon and I guess that you want to get the value of global variable by override value during the execution. If you want to override global variable, please help to refer to this link: https://docs.katalon.com/katalon-studio/docs/execution-profile-v54.html#update-global-variables-during-runtime

In addition, you want to override Email with Global Variable value (not default value), I think this post may be useful: How to set date today in email summary? - Katalon Studio / Web Testing - Katalon Community

FYI

hi @shawn.shen,

There is another way to work around with below steps:

  1. Identify you profile path, the path looks like: filePath = RunConfiguration.getProjectDir() + “/Profiles/default.glbl”

  2. Declare your new variable values

  3. Override the file with new value

  4. Then you are able to run with override value of global variables

Based on this approach, if you want to put report date into email, just:

  1. Declare variable with default value
  2. Identify Profile path
  3. Using cmd to generate new date
  4. Override new date into the file

Hope it is useful.

FYI.

Hi @loc.nguyen,

Sorry for the late reply. I’ve done the testing following the workaround you mentioned.

Thank you very much!

Now, I can override those global variables’ values under studio mode. The steps are:

  1. Create the variables in Studio, using the default profile.
  2. In the test case, parse the default.glbl and update the initial values for these variables as expected.
  3. Run the test suite and get the correct value in the mail.

Though the workaround works well, I still want to know that do we plan to provide a more simple way to override them? Like what we did to update the values of the global variables when executing cases.

Thanks again.

hi
can you help me out–
e.g
Get value (stored in A variable)
I am getting email with completed log (Test suit )
Can i get only Variable value only in email ?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.