# Storing and calling variables - does not work at all like Selenium IDE

**URL:** <https://forum.katalon.com/t/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide/9180>\
**Category:** Web Testing\
**Tags:** katalon-recorder\
**Created:** [January 31, 2018, 4:18pm UTC](https://forum.katalon.com/t/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide/9180 "2018-01-31T16:18:09Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kathy\_Anderson](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@Kathy\_Anderson](https://forum.katalon.com/u/Kathy_Anderson)\
**Post date:** [January 31, 2018, 4:18pm UTC](https://forum.katalon.com/t/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide/9180/1 "2018-01-31T16:18:09Z")

</div>

In Selenium IDE I have dozens of variables that are created in one big test case, and then are called frequently in the other test cases in my test suites. For example, I use something like "command \> store Target \> [bob.smith@email.com](mailto:bob.smith@email.com), Value \> userLogin. In my test scripts, I would then have Command \> type, Target \> UserName, Value \> ${userLogin}. I’ve found that this does not work in the Katalon Automation Recorder, AND I found (super annoying!!!) that if a test script fails, all the variables I created in my “variables” test script get cleared out!

This tool needs to allow for users to create and store variables in one test script, keep those values stored no matter what happens in the associated test cases, and to allow for one to call those variables across all test cases in a suite.

Another thing I do frequently is compare a current value to a stored value, such as with date fields. For example, if I store a variable such as startDate 11/1/2017, I need to be able to verify that after entering that variable in a field and saving, that the value is displayed on another page, for another user. I also use “gotoif” type logic very frequently, and need that to function like Selenium IDE as well or this tool just won’t do much for me beyond basic happy path testing.

---

<div class="post-metadata">

**Author:** ![Patrick\_Groot](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/patrick_groot/32/9976_2.png) [@Patrick\_Groot](https://forum.katalon.com/u/Patrick_Groot)\
**Post date:** [February 1, 2018, 10:45am UTC](https://forum.katalon.com/t/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide/9180/2 "2018-02-01T10:45:06Z")

</div>

Well i had the same issue and went also to the people at selenium. They say that this is not possible anymore!

> <https://github.com/SeleniumHQ/selenium-ide/issues/88>
>
> In the old situation/test cases from the old IDE we used one test case that we a…lways put as a start of our test suite and those variables could be used by all the following test cases inline. I'm not sure if you were able to run multiple suites at once. 
> 
> But my ideal solution the variables are usable and stored/available for all test suites and cases.

> That can not be the case, although in Selenium IDE test cases are ran one by one in a synchronized fashion, we are actively working on exporting Selenium IDE projects to webdriver code where it will be ran in parallel.  
> Thus you can’t rely on a test case to be ran before you, and use it’s variables.  
> And since test cases will be ran independently in webdriver, they can’t share variables between them, you would have to re-evaluate any or all variables before each test.

I’m also not happy since we have a huge number of test cases and need to inplement it in every single test case now. Not really a friendly solution i would say! Actually it’s a absolute nightmare… 😄

I created a ticket a few days ago with some findings/issues along the way when we were migrating the test suites/cases.

> **[\[Katalon Automation Recorder\] \[Section\] Tab \> Variables](https://forum.katalon.com/discussion/4864/katalon-automation-recorder-section-tab-variables#latest)**
>
> \[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.

---

<div class="post-metadata">

**Author:** ![devalex88](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/devalex88/32/336_2.png) [@devalex88](https://forum.katalon.com/u/devalex88)\
**Post date:** [February 6, 2018, 12:21pm UTC](https://forum.katalon.com/t/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide/9180/3 "2018-02-06T12:21:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mark\_Adkins](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mark\_Adkins](https://forum.katalon.com/u/Mark_Adkins)\
**Post date:** [February 15, 2018, 6:31pm UTC](https://forum.katalon.com/t/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide/9180/4 "2018-02-15T18:31:25Z")

</div>

Any idea when the 3.2.0 version will be released. This is a big roadblock for us in moving our Selenium tests over to Katalan

---

<div class="post-metadata">

**Author:** ![Patrick\_Groot](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/patrick_groot/32/9976_2.png) [@Patrick\_Groot](https://forum.katalon.com/u/Patrick_Groot)\
**Post date:** [February 16, 2018, 8:17am UTC](https://forum.katalon.com/t/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide/9180/5 "2018-02-16T08:17:47Z")

</div>

> Mark Adkins said:
> 
> Any idea when the 3.2.0 version will be released. This is a big roadblock for us in moving our Selenium tests over to Katalan

It’s released already some time ago. **Current**  **version** is **3.2.2**

---

<div class="post-metadata">

**Author:** ![Peter\_Nicolaisen](https://avatars.discourse-cdn.com/v4/letter/p/91b2a8/32.png) [@Peter\_Nicolaisen](https://forum.katalon.com/u/Peter_Nicolaisen)\
**Post date:** [March 5, 2018, 1:35pm UTC](https://forum.katalon.com/t/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide/9180/6 "2018-03-05T13:35:11Z")

</div>

> Patrick Groot said:
> 
> > Mark Adkins said:
> > 
> > Any idea when the 3.2.0 version will be released. This is a big roadblock for us in moving our Selenium tests over to Katalan
> 
> It’s released already some time ago. **Current**  **version** is **3.2.2**

Hi Patrick,

is storing variables in one and calling them in another case working for you now?  
I can’t bring it to work with our test suits.  
I’m trying to store an url: ![](https://s3.amazonaws.com/katalon-forum/editor/7a/e3wtu4459xe0.png "Image: https://s3.amazonaws.com/katalon-forum/editor/7a/e3wtu4459xe0.png")  
and call it in a later case using “open” “${currentenvironment}/AnotherExample”.  
But checking the variables - tab once the next case starts, it seems KAR doesn’t save it at all.

(I’m completely fresh meat to this… maybe I’m just not seeing the obvious here…)

[grafik.png](https://s3.amazonaws.com/katalon-forum/editor/7a/e3wtu4459xe0.png)

---

<div class="post-metadata">

**Author:** ![Patrick\_Groot](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/patrick_groot/32/9976_2.png) [@Patrick\_Groot](https://forum.katalon.com/u/Patrick_Groot)\
**Post date:** [March 5, 2018, 2:09pm UTC](https://forum.katalon.com/t/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide/9180/7 "2018-03-05T14:09:15Z")

</div>

> Peter Nicolaisen said:
> 
> > Patrick Groot said:
> > 
> > > Mark Adkins said:
> > > 
> > > Any idea when the 3.2.0 version will be released. This is a big roadblock for us in moving our Selenium tests over to Katalan
> > 
> > It’s released already some time ago. **Current**  **version** is **3.2.2**
> 
> Hi Patrick,
> 
> is storing variables in one and calling them in another case working for you now?  
> I can’t bring it to work with our test suits.  
> I’m trying to store an url: ![](https://s3.amazonaws.com/katalon-forum/editor/7a/e3wtu4459xe0.png)  
> and call it in a later case using “open” “${currentenvironment}/AnotherExample”.  
> But checking the variables - tab once the next case starts, it seems KAR doesn’t save it at all.
> 
> (I’m completely fresh meat to this… maybe I’m just not seeing the obvious here…)

Not sure what you’re referencing to but for me everything seems to work with no problem at all.

\*\*Test Suite 1 \> Test Case \*\*  
store | [https://yoururl.com](https://yoururl.com) | yourUrl

\*\*Test Suite 2 \> Test Case \*\*  
echo | ${yourUrl}/something |  
open | ${yourUrl}/something |

The log indeed shows the following for the open command ${yourUrl}/something but you can use the echo to see if the url is correct as in the example above.

---

<div class="post-metadata">

**Author:** ![devalex88](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/devalex88/32/336_2.png) [@devalex88](https://forum.katalon.com/u/devalex88)\
**Post date:** [March 5, 2018, 2:16pm UTC](https://forum.katalon.com/t/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide/9180/8 "2018-03-05T14:16:17Z")

</div>

Hi Peter,

Would this work for you [https://gist.github.com/devalex88/42d8f56657797610242d868654dfd159](https://gist.github.com/devalex88/42d8f56657797610242d868654dfd159)?

---

<div class="post-metadata">

**Author:** ![Peter\_Nicolaisen](https://avatars.discourse-cdn.com/v4/letter/p/91b2a8/32.png) [@Peter\_Nicolaisen](https://forum.katalon.com/u/Peter_Nicolaisen)\
**Post date:** [March 5, 2018, 3:28pm UTC](https://forum.katalon.com/t/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide/9180/9 "2018-03-05T15:28:26Z")

</div>

> Patrick Groot said:
> 
> > Peter Nicolaisen said:
> > 
> > > **…**
> > 
> > Hi Patrick,
> > 
> > is storing variables in one and calling them in another case working for you now?  
> > I can’t bring it to work with our test suits.  
> > I’m trying to store an url: ![](https://s3.amazonaws.com/katalon-forum/editor/7a/e3wtu4459xe0.png)  
> > and call it in a later case using “open” “${currentenvironment}/AnotherExample”.  
> > But checking the variables - tab once the next case starts, it seems KAR doesn’t save it at all.
> > 
> > (I’m completely fresh meat to this… maybe I’m just not seeing the obvious here…)
> 
> Not sure what you’re referencing to but for me everything seems to work with no problem at all.
> 
> \*\*Test Suite 1 \> Test Case \*\*  
> store | [https://yoururl.com](https://yoururl.com) | yourUrl
> 
> \*\*Test Suite 2 \> Test Case \*\*  
> echo | ${yourUrl}/something |  
> open | ${yourUrl}/something |
> 
> The log indeed shows the following for the open command ${yourUrl}/something but you can use the echo to see if the url is correct as in the example above.

Hey Patrick!  
Maybe I missunderstood your inital post in this thread - thought you had the same problem. Nevermind then.

Situation was:  
Test Suite 1  
Test Case 1 - SetBaseUrl - stores the URL as variable “CurrentEnvironment”  
Test Case 2 - Login - opens “${CurrentEnvironment}/login”

What I expected (from the few times I used Selenium IDE before):  
Test Case 2 knows ${CurrentEnvironment} natively, because it was stored from Test Case 1.

What happend:  
Test Case 2 basically just typed out ${CurrentEnvironment}/login into the address bar instead of using the stored URL.

This seems to be fixed when using “echo” “${CurrentEnvironment}” before “open” “${CurrentEnvironment}/login”.

> [Alex](https://forum.katalon.com/profile/2620/Alex "Link: /profile/2620/Alex") said:
> 
> Hi Peter,
> 
> Would this work for you [http://forum.katalon.com/discussion/5002/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide? · GitHub](https://gist.github.com/devalex88/42d8f56657797610242d868654dfd159)?

Hi Alex,

thanks for the help. Problem’s solved. 🙂

---

<div class="post-metadata">

**Author:** ![devalex88](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/devalex88/32/336_2.png) [@devalex88](https://forum.katalon.com/u/devalex88)\
**Post date:** [March 6, 2018, 3:15pm UTC](https://forum.katalon.com/t/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide/9180/10 "2018-03-06T15:15:20Z")

</div>

It’s great to hear that :). I’m gonna close this discussion. If anyone needs support, don’t hesitate to start a new one. As always, thanks everyone for your great feedback.

---

<div class="post-metadata">

**Author:** ![vweerasinghe](https://avatars.discourse-cdn.com/v4/letter/v/977dab/32.png) [@vweerasinghe](https://forum.katalon.com/u/vweerasinghe)\
**Post date:** [February 9, 2019, 1:53am UTC](https://forum.katalon.com/t/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide/9180/11 "2019-02-09T01:53:23Z")

</div>

Just to make sure I understand. You are saying if variable A was made in test case A. Then variable A can be used in test case B.

Is that correct? If that is correct, is there a link to the process?

I made variable A in test case A. Variable A was given a value in test case A. I want to use variable A in test case B. However, when I attempt to to this, variable A does not appear on the lists. Variable A is a string.

---

<div class="post-metadata">

**Author:** ![mlopez1](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@mlopez1](https://forum.katalon.com/u/mlopez1)\
**Post date:** [May 20, 2019, 7:18pm UTC](https://forum.katalon.com/t/storing-and-calling-variables-does-not-work-at-all-like-selenium-ide/9180/12 "2019-05-20T19:18:13Z")

</div>

It’s possible to open new tab with the URL in a variable

 ![Screenshot_1](https://europe1.discourse-cdn.com/katalon/original/2X/e/e3d50127ff11dec212d22e3b645a6e457f319377.png)

It´s not working
