Turn your manual testers into automation experts! Request a DemoStart testRigor Free

Tips & Tricks – Using Data Sets in Test Automation


The use of variables is critical to testing. This session shows how you can use data sets as variables and link them to your test cases. This powerful feature in testRigor will help execute more tests by just specifying more test data.

Connie Lund: Hello, everyone and welcome to our second Tips and Tricks session for March 23. Today’s topic is the use of data sets in test automation and, variables are critical to your testing. So CEO of testRigor Artem Golubev is going to do the presentation today. Please ask questions. You can put them in the chat or in the question section. Our goal is to answer your questions too. So Artem take it away.

Artem Golubev: Hello everyone, and today’s topic will be about test data sets. Basically, what do you need test data sets for example you need to have different versions of values for some forms. That’s the number one most common use case or do some other things which are almost the same except like one thing is changing for your test or several things are changing. And it is better to have one test with a test data set. It’s just go through all of these data. Obviously it’s easier for you to just have a load application and test. So it’s just one test with parameters and when you modify a test data set in order to be able to deal with it and for that I’ll share my screen and show you an example on this wonderful website.

Someone has created a QA playground and it has lots of good examples.

We’ll start from creating a test suite. So that’s for the QA Playground. And without any username and password to record engineering then you pass. Let’s just test it. And here you can create Let do some records we can click on web apps. Then there’s a bunch of web apps in there. And almost every web app has versions in HTML, CSS or JavaScript. So what we can do is basically, we can create a dataset HTML, CSS, JavaScript, and then use that to test different sections. Let’s say, JavaScript this time. And let’s say that if you want to validate that it is active. Let me stop recording and forward the validation. All right. We must click web apps like this. You don’t need open URL and here we’ll click vanilla JavaScript. And but the relative location would be not on the left of CSS. It would be below dynamic table because that’s where the name of each is section?

So it should cover below the dynamic table and then, expertly call this hand and then a table and here we want to validate that our Ironman status is active check that the table at the row containing “Ironman” and column “Statues” contains “Active”. All right, great. And the original one has mini web apps.

Okay. Let me go ahead and edit. So this is this version does not have any parameters while it is running as a simple test, which we will then modify to introduce parameters on the web app and as you can see even the RMA and is now in a different position it still succeeded. Now, like we created this test, right, it goes through. Tbe clicks says finds JavaScript below this section. So good and now we need to run the same test for HTML, CSS, and JavaScript. And for that, we will create a test dataset, which would contain HTML, CSS, and JavaScript. Then we will use this test data sets to run our test on that test data set and use various parameters so our test will run three times.

All right. We’ll go to test data. We switch to data sets. And we’ll click add to add new data set, and we need to give a name to this data sets, and we’ll call it types of rendering. So we have created data sets. Rendering has variables and rows. Variables are columns. So these are the variables which will have different values and data sets. And let’s add one. Text hidden would be applicable for passwords and files clearly, to upload files. 

In our case, it’s just plain text. And let’s call it “type that will render”, and we copy that because we’ll need it to go forward. Okay, we have one variable now let’s go to rows and add rows. Let’s click Add. Then just do HTML. We need to give a name to this row and the value of HTML and let’s add another one CSS the value would be CSS and another value would be JavaScript. So we have three rows. Each of them would have different value for this type of random variable, HTML, CSS and JavaScript.

We have some questions here. Are we going to place a field capture for the purpose of a test case? Okay, so title does not provide enough info for field to capture, I did not understand the question. Title is just how you name your test case. You shouldn’t just provide a readable name. So here let’s link data set. First, we have only one data set.  Let’s link it. And let’s add it’s a data set. And instead of JavaScript here, let’s convert it to reference stored value based on the type of render, we should copy it and update and retest.

Let’s give it some time. So let me try to understand the question again. Okay, so I guess what the creation is about is the naming of zeros we named [unintelligible] html CSS and JavaScript that you can use more meaningful descriptions of each row because each row might contain multiple different values.

Connie Lund: The question is, how many characters can a row name have, so that you can put them…?

Artem Golubev: No I don’t believe row name have a limitation because very large limitation like files or some characters.

Connie Lund: So then you can put a longer name in, that makes sense.

Artem Golubev: Okay, interesting. So in this case, it’s failed because the page didn’t render.  So anyway, let’s try to rerun it again. If we go to CSS it didn’t render just to retest CSS specifically. Rendering is waiting and now it does not render maybe it’s a one to one machine[00:13:05]. So let’s go ahead and add another browser. Go back and retest. And that should basically test all the conditions. And we can see all of them if you could open up this execution and the new tab go over so you can see there’s quite a number of different combinations in here, because there are different browsers for each data set. So there’s a Ubuntu chrome and Windows Chrome for HTML data set, Ubuntu chrome and Windows Chrome for CSS data set. And same for JavaScript dataset. Executing right now as you can see.

Yeah, it looks like maybe [Unintelligible] application but the test have Issues consistently with CSS specifically. Well, I guess we found issues related to rendering of the application is CSS. Let me Make sure [inaudible] it’s really clicking on the right place. And oh, no. It’s been clicking somewhere else. It should be tailwind-CSS. Okay, so there it goes, we find out what’s going on. It just didn’t clicked on the right thing. So we should say tailwind-CSS as we go back to the data set, go to rows for CSS version instead of CSS type the tailwind-css and that should fix it so I’ll go back let’s remove additional browser that will run it a bit faster. Let’s open the app in a new tab and let’s see how all of that executes. It’s all succeeded this time we are be able to identify the issue of our data. And you click tailwind CSS now. And this is an example of how you would use the data sets in testRigor, as you have seen already, you can also use a combination of multiple browsers and data sets and it will end up being Cartesian multiplication. So we have the combinations of all browsers if all data in data sets for each of the browsers. 

Each of the browsers will run all data and data sets. So exactly as you would expect for tests and it’s very easy to deal with or here you can see all those executions on one page. Or you can just switch between them and here and see how each of them performed. So this is how you work with test data sets. The Do you have any questions? Does anyone have any questions?

Connie Lund: So if you have questions, please ask. Peter’s asking, Can you click variable contains vs equals. Is there an option for that? Artem I think you’re on mute.

Artem Golubev: If the question is, can we use validations, which has contains validating a variable or is a question if he can click on something containing a variable which one is that? So in both cases, the answer is yes. Or I think actually what’s the question is, can he click on something based on text containing the thing and not just being equal. And this is exactly what we did several times. So if you remember here in case of JavaScript as a store value for us is JavaScript but we clicking run new JavaScript. So that’s a partial match. I’m practicing what you’re asked. This is one example. And the last example is the very beginning. We click Apps and it finds mini web apps. So that’s another example of how it clicks with partial match, so by default, testRigor would do case insensitive contains and this is how it will find elements. 

However, you can force it to match if you use the word of exactly you can say click exactly mini web apps and it will match both case sensitive and full string. Okay, so why did we not use when we click on CSS, providing they work? 

It looks like it’s because the element below had a CSS as a full string server and because CSS full string would have like higher match, right because it’s a full string match. It would prefer to select their full string match as opposed to partial match, like in CSS, in order or to overcome that is what you needed to do is just made it full string CSS.

Connie Lund: So Peter, your mic is open. If you’d like to ask more questions.

Guest: No, no, I was just a little confused when it  didn’t pick it up. So what did it show your res CSS when it when it looked at it? Or did it…

Artem Golubev: It did highlight it if you remember, so we can get back to it and see what it highlighted.

Guest: What did it highlight so when it was looking for this CSS when it couldn’t find it?

Artem Golubev: It’s just basically two precedents compared to CSS here, because CSS is the full string match versus CSS. Therefore, it prefers to click in here as opposed to clicking here. Nevertheless, this is why we have we had to specify this CSS.

Guest: Got you. Now I wanted to click… Okay. All right. Thank you.

Artem Golubev: Okay, is there anybody else that has questions?

Guest: So I’m just kind of curious the data like we can put multiple users in the variable in this dataset and cycle through those users?

Artem Golubev: Yeah, that’s a great use case to do that. So basically, in that case, what you do is you create a data set, let’s call them users. So mind you, you can just upload the data from a CSV. So you can just create the CSV data what let’s just create some rows manually and we go ahead to create some variables first. First will be username. And another variable would be hidden password.

Guest: So when you when you say hidden password, so when the test case runs through testRigor. We’ve seen where the password seems to be displayed in the steps. Does it gets hidden in the script as well as steps in the test case when it executes.

Artem Golubev: Yes, it will be hidden across board. It will be basically indicating that it is the password and should not be shown, unless of course it will pop up on the screenshot, right? If you’re entering into open field, then you will be able to see it.

Guest: Yeah assuming it’s masked or whatever when you entered in the password.

Artem Golubev: Yes, it shouldn’t be in this case. Anyway, that would be user one and, as you can see, it has username and password and let’s add another row called user two. And call it user two and, as you can see, are two users here so you can use these datasets or run stuff for two users.

Guest: You can technically use this for like load testing?

Artem Golubev: Absolutely. Yes. So keep in mind, though, in a load testing you may have more prioritizations when you have users you might have just like 10 users, but you’re running it on 1000 servers. So they will then run the issues or multiple times. 

Guest: Yeah, exactly. But there is some form.

Artem Golubev: This is exactly what you would expect us to do. Because like if you have more prioritizations for load testing, you need to be able to use those even though you might not necessarily have all the users available.

Guest: Is there a limit number of variables you can have on a row? 

Artem Golubev: No. Certainly not.

Connie Lund: All right. Is there any other questions from Peter or anyone else? Anything else that you want to add Artem about use cases for data sets and variables?

Artem Golubev: Yes, the major thing is, tying different forms with different values. This is probably the most common use case you could also use to validate for example, different types of sampling if you have drop down of type and you can do that. That’s most prevalent as you can see, up. Here is more a little bit more complex case where you use different buttons and different options. Where to go different paths even because we click on different methods. Okay. Well, that wraps it up from my side.

Connie Lund: All right, we’ll wrap up this session. Thank you, Pete and everyone for attending. And we’ll have our next session next Wednesday at this time again, thank you everybody for attending. Have a good day. 

Guest: Thank you.

Artem Golubev: Thank you. Bye.