Working with Parameterized tests: ATF Walkthrough #4
hi everyone um so this is another um session for our ETF walk through Washington DC series as usual I'm here with um Amanda um today we'll be talking about parameterized test in ATF um which basically means using different test data to run your test yeah so today um the agenda we have um is going to be understanding parameterized test also we'll talk about components of parameterized test will um do talk about a couple of the best practices which will come after um amand demos out to use parameterized test on parameterized test um this is first thing we're going to talk about and as a test designer the whole goal of this is to create and run automated test with specific data sets B can be used um to run your ETF test um the r concentration you should know about parameterized test this um for the support um parameterized test support the standard ETF features such as report test suit and data you can also use custom us test tpes when when you're using parameterized test what's not supported is you can't use um the wrong Ser side script test step um for parameterized test so this is what you should know about parameterized test then the the next thing we're going to talk about is the benefits of using this um kind of um ITF test is the the first one being itate needs to duplicate test steps just to change your test data so um imagine the situation where you have you already have your test data you don't need to create a new test step because you want change data or see the out output of you changing the data so this helps you eliminate that um long process the next one is um it increases the the visibility of um your test or your test SHO um by separating test actions from the test data and the third one being produces a separate test result for each each data set so you can be rest assured that whenever you change your your input variable you would get um a different output based on what you setting um the components of parameteres uh basically two the first one is the parameter the second one is data set so for parameter um this is a variable that stores the specific data data that you are adding into your ATF test and it can be characterized as um being shared or exclusive now we're going to move over to the demo um I'm going run us through what um the typical um process of Designing a parameter yes so I will share my screen so that we can move on to that demo thank you okay so here I am just in a typical service now instance so we'll navigate to the ATF test and I'm actually going to use one of the out of boox Quick Start tests and show you how to kind of modify that into um parameterized testing me go to here um the one that I will choose is this incident creation self-service so it's just a simple test that uses a service catalog um to create an incident and what we're going to do is kind of run through these options these are going to be our data sets and we're going to run through a high medium and low um priority and kind of make sure that the um test is properly submitting those incidents um so for the purposes of this demo I'm just going to delete some of these just because we're going to create three it's going to run through this three times and we want to not go over take a bunch of your time staring at a screen so let me delete half of these and the first step when it comes to creating these param I testing it is disabled by default so you actually want to turn that on and then click save and like we saw on the slides we have the parameter parameter definitions um data sets and then this test results switch to parameterized test results because it's going to run for each single data set that you have um so you'll be able to see all of those results here um for the parameter definitions let me just consolidate this um for the parameter definitions this is going to be like your specific variables um so I'll go through these test steps in a second um on this set variable value steps what we're specifically going to do today um is switch out um these data this these um variables here the data in these variables so urgency we're going to run through all of the options um and test we're just going to put some some sample data in there um so the parameter definitions are going to be the actual variables urgency and then this please describe your issue um below typically the short description we'll create those here um so there should be a shared parameters as well we only see the exclusive this is because we're in a specific scope um kind of what you see in this message here so if you do switch to Global for example let me go back switch to Global there you go then you'll be able to see that add shared parameters and what this does is allow you to use a group of um variables between multiple tests um so in this example yes we have to Define variables for this one one test but um what the benefit of this is you can set up these variables one time and reuse it among different tests so it's not um it kind of reduces the amount of work that you have to do between these um tests so I will go back into the scope go ATF test and then we're going to create these parameter definitions and like I mentioned earlier we're going to be doing urgency and then a short description um so we're going to add an exclusive parameter you're able to select the type this is just what type of um variable it is and in this case it is a choice because we have multiple options as far as the label I'm just going to call it urgency and it will automatically create a name but I'm just going to put _ there so I know it's mine um and then as far as the choice options here let me see drop down with none we do have that none option so I'm going to select that and then you want to actually save instead of submit um this is going to display a related um list so that you're able to create all of those choices that we see in the record producer and this is where you will Define specifically this choices one by one um so the label here and the value the label and the value do matter because depending on how you set it up your test might fail um so as far as the label this is just what you see on the front end it doesn't typically matter what you put so for the purposes of this I'm just going to copy these label values that we see here um so we're going to do one I but the value is the important part um and this value urgency or this variable urgency specifically maps to the urgency field in the incident record um so you want to make sure that you click into here um configure dictionary and then you will see that high has a value of one um if this doesn't match you might have some issues when running that it might not be able to detect and um set the correct variable value um and then this isn't really a required field but I just want this to be first so I'm going to set that sequence as zero and then we're going to kind of repeat for the others so let's see two medium [Music] one submit and create that last one three low value of three and then sequence of two so now we'll update that let's see let me go back to my test here I'm just going to rename this so I'm able to find it [Music] okay so now we have the urgency mapped out and the next field that we need to create is this description below um so again add that exclusive parameter uh we're going to type description change this name and then this is going to be a string and this looks like a longer string so I'll click this one and then we will submit this option since there's no choices it collects user input um as far as the data sets so this is actually what is being ran um there's two options here we have this import option and this new Option I'll start with the new for now um and kind of show you how it works so here's the variables that we have defined description and urgency and then for the first one we're going to click number one priority and then say maybe a test value and submit them and like I mentioned we do have this import option as well if you want to import a large number of data um there is some instructions on how you want to do it um you can either replace or add some of the entries that you have here but I do find this option specifically helpful that do you want to create an Excel template to enter data just because this tells you exactly how you need to enter data into the Excel sheet for it to properly um submit your import data these data sets um and I do already have this downloaded so I'll switch over to this slide um and it does come with some directions on this first initial page and page one comes with specifically the variables that you have defined so you want to set that active as either true or false um this description again this is a string field so you can kind of type whatever you want order and then your this one was a choice so the choices that we've defined it displays here for you to click on okay so now I am going to just add a couple of more uh let's see again this one urgency of two this time and then last one s two urgency of three so this test is now going to run three times since we've created these three data sets um and the last option is to actually modify the values um so this specific step this is the one that we are switching out that data so you want to click into here and right now it's pretty static um it's going to run through the current values but how you want it to point to those um variables that we've just created is with this data pill here and you'll see the parameters options um so for the urgency you want to click on that and then for this string field here you would like to click on the description and the last thing this specific um test does do some field validation so in order for it to pass we need to make sure that we're validating the fields that are in those parameters so again we kind of need to do a similar thing which is to urgency and then point it to the parameters that we've created okay so I will update that and then let's see let me do a quick missing that run test button one second I think you need to click on the active copy test okay yeah this one was forgot to copy um but thankfully I have it open on another slide here so it's exactly the same okay yeah forgot to copy that test first U but yes of course copy the test instead of modifying the action um quick start test just because those have a production policy of them so that's why it kind of gave me that error there um but this one exact same steps I already had it um created so we'll just run through that so we're able to see let's see so again it's kind of running through those options here and then it is going to confirm um that those fields were set okay now I'll click this run test button and then we will actually watch um it run through all of these data sets Okay frame here okay now it's running through the second data set and it will change that to a medium priority instead and then similar to the the back end and you're able to see some additional logging information and then validating here is able to reflect on the back end as well then that last data set will be on low and then reflected here so that would be how you set up your parameter variables and then create these data sets nice and then again everything succeeded and then you're able to kind of go to the results and see the um steps for all three Those runs yeah nice was very fast also total of um you could say one minute and 40 seconds or so ype all right I will stop the share then we can the best practices all right so um now now that um we've gone through the demo um the next thing is to talk about the best practices and I'm sure if you paying really good attention you see some of the things amand did while she was doing the demo and I'll talk about some of them here like the first one being the Strategic parameter design she carefully um created an Exel sheet where she inserted all those um parameters she was going to um impute into the test and the second one being efficient data set management um you this is needed because um effective data set contribute to the clarity of the test scenarios so you want to know what you're trying to get inside the test to know the output you're getting out so that's the point of efficient data set management um the next um best practice best practice we would also recommend is regular review of your test design you should like maybe I would say on a maybe monthly basis or whenever you on your test you should always look and see if your test design are the way you want them to be always update update them as a case me B if you want change the the input of the data and the next one is optimized use of Shar and exclusive parameters um am mother clearly showed us how how to use each of this um things each of these parameters each each of this um option as the case may be she showed us how to use the shared parameters and the exclusive parameters um so you should also thoroughly analyze your parameter parameterized test result we also saw how she went through the test result and we saw the the the time it took to run each of the the test itself based on the input we got so um I guess with that um we can say we've been able to show you efficiently and effectively how to use parameterized test betweenin ATF all right so um thank you everyone um and um we look forward to you um joining also watching the next um video series we're going to release for ATF thank you everyone all right bye for now
https://www.youtube.com/watch?v=RF-WnXONek8