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


#1

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, 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.


#2

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

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… :smile:

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


#3

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.


#4

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


#5

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


#6

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:


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


#7

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:


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 | 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.


#8

Hi Peter,

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


#9

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:


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 | 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 said:

Hi Peter,

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

Hi Alex,

thanks for the help. Problem’s solved. :slight_smile:


#10

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.


#11

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.