[Katalon Automation Recorder] [Section] Tab > Variables


#1

[Katalon Automation Recorder] [Section] Tab > Variables

The section seems to be always empty. Alse when variables are used there is nothing shown in the Variables section in Katalon Automation Recorder.


#2

We identified the problem. It looks like you need to have everything in one and the same test case. This makes it fur us not really easy to maintain.

In our situation coming from the old Selenium IDE we used only 1 main config file that we played before all other test suites/cases.


#3

Manual execution

Another point: Manual execution of test/step variables are not working.

Javascript?

It’s not possible anymore to use…

Store| JS | Variable

javascript{(new Date().getHours()+":" + new Date().getMinutes() + ":" + new Date().getSeconds())}


#4

Solved the JS problem

I was still in the progress to make all old cases compatible with the katalon recorder.

Changed the following and used **storeEval ** instead.

new Date().getHours()+":" + new Date().getMinutes() + ":" + new Date().getSeconds()

Manual execution (BUG?)

Another point: Manual execution of test/step variables are not working.

Sharing all variables with other suites and cases inline (BUG?)

We like to execute the config(suite) only once and then run all other test suites/cases using those stored variables.


#5

Hi Patrick. Thank you for all your help on KAR - we really appreciate your reviews and suggestions!

I’m happy to inform that variables will be persisted between test cases from version 3.2.0. If there is any issue, feel free to let us know and we will resolve it as soon as possible.


#6

Alex said:

Hi Patrick. Thank you for all your help on KAR - we really appreciate your reviews and suggestions!

I’m happy to inform that variables will be persisted between test cases from version 3.2.0. If there is any issue, feel free to let us know and we will resolve it as soon as possible.

Hallo Alex,

That sounds awesome!

Can’t wait for the release :smiley:

Thanks for the amazing work and support.


#7

I am new to Katalon, but I have an issue with using variables in 3.2.2 in Firefox 57.

I can define the variable and the value of the variable is correctly set during execution (verified via the Variables tab), but when I go to try and use (e.g. type) or even display (echo) the variable using say “echo ${variableName}” then all I end up getting is “echo: variableName” (the name of the variable, not the value!)

Please help!


#8

Cybes said:

I am new to Katalon, but I have an issue with using variables in 3.2.2 in Firefox 57.

I can define the variable and the value of the variable is correctly set during execution (verified via the Variables tab), but when I go to try and use (e.g. type) or even display (echo) the variable using say “echo ${variableName}” then all I end up getting is “echo: variableName” (the name of the variable, not the value!)

Please help!

Please show an example. All i can say is that i didn’t test it using firefox. Will have a look if that makes any difference for us.

**EDIT **for us firefox is also working without any problems.


#9

“Solved” my own issue, updated to Firefox 58 and the issue “disappeared”


#10

Hi

I am on FF 59.0.2 and i am still not able to make variables work as it does in Selenium IDE.

**Command: **Store
**Target: **varLTcl
Value: Yahoo

Usage

**Command: **assertTextPresent
Target: ${varLTcl}
Always fails. Echo also doesn’t display the actual value. And **Variables **tab somehow also blank.

I appreciate any help. Thank you very much!

Thank you
Andrew


#11

I made a new post in the General Discussions section (link) but I think it might actually be the same issue. I’ll copy here as well.

Here are the commands I’m using in Katalon Recorder and Chrome (latest version: 65.0.3325.181)

runScript | var test = 5;
storeEval | window.test | testvar
echo | ${testvar}

Result: [info] echo: null

It seems like a bug to me. Or is there a different way to get Javascript variable into a variable in Katalon Recorder?


#12

Hi. Thank you for using our product. The right syntax is “store | value | var_name”. Could you please try again and tell me the result.

Andrew said:

Hi

I am on FF 59.0.2 and i am still not able to make variables work as it does in Selenium IDE.

**Command: **Store
**Target: **varLTcl
Value: Yahoo

Usage

**Command: **assertTextPresent
Target: ${varLTcl}
Always fails. Echo also doesn’t display the actual value. And **Variables **tab somehow also blank.

I appreciate any help. Thank you very much!

Thank you
Andrew


#13

I’ve answered in the original discussion. Thank you for the feedback.

Sev Kni said:

I made a new post in the General Discussions section (link) but I think it might actually be the same issue. I’ll copy here as well.

Here are the commands I’m using in Katalon Recorder and Chrome (latest version: 65.0.3325.181)

runScript | var test = 5;
storeEval | window.test | testvar
echo | ${testvar}

Result: [info] echo: null

It seems like a bug to me. Or is there a different way to get Javascript variable into a variable in Katalon Recorder?


#14

Thank you Alex,

I have tried. Please see attached 2 images.

Thank you again!
Andrew

Var-Echo-Sample-1.png

Var-Echo-Sample-2.png


#15

Could you please send me a sample script?


#16

Andrew said:

Thank you Alex,

I have tried. Please see attached 2 images.

Thank you again!
Andrew

You should run the test case and not execute the test steps, step by step because then it’s lost.


#17

Thank you Alex i apologize for late response!

Do you know if Katalon recorder will have such a feature to do step by step test?

Andrew


#18

You can right-click on any step and choose toggle breakpoint. The execution will pause right before this step - to continue just click “Resume”. You can set multiple breakpoints to debug your script.


#19

Hello, how can I use the same variable in different tests on katalon record?


#20

Alex said:

You can right-click on any step and choose toggle breakpoint. The execution will pause right before this step - to continue just click “Resume”. You can set multiple breakpoints to debug your script.

Thank you Alex! I eventually figured - now switched to Studio…