Advanced Test Automation using Boozang | Mats Ljunggren | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Advanced Test Automation using Boozang

teacher avatar Mats Ljunggren

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

26 Lessons (1h 41m)
    • 1. Why Test Automation Boozang

      2:04
    • 2. Signing up

      3:22
    • 3. Recording a first test

      3:33
    • 4. Overview of the Boozang tool

      4:08
    • 5. Adding items to a list

      3:26
    • 6. Adding item based on data parameter

      3:24
    • 7. Adding items using a data loop

      5:39
    • 8. Re-using sorted list test cases for unsorted module

      3:26
    • 9. Cleanup item in unsorted list

      3:22
    • 10. Creating a data loop with cleanup

      2:59
    • 11. Adding validation condition to loop

      5:02
    • 12. Doing a form using static data

      3:13
    • 13. Doing a form fill with dynamic data

      2:21
    • 14. Adding data validation

      2:52
    • 15. Randomly generating form data

      4:08
    • 16. Autofilling forms using Boozang regexp engine

      3:34
    • 17. Speed game: Handling re-tries for dynamic elements

      4:24
    • 18. Wait game: Handling explicit waits

      3:41
    • 19. Using the comment function to annotate bugs

      4:36
    • 20. Reporting bugs and team work

      3:32
    • 21. Yellow or red: Handling if-conditions using groups

      6:34
    • 22. Robustness of tests and how to use AI repair

      4:00
    • 23. Repairing a multi-action tests using AI

      3:52
    • 24. Extracting and using data from application

      5:30
    • 25. Playing collecting kittens

      5:57
    • 26. Performance tuning

      2:38
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

26

Students

--

Projects

About This Class

To automate testing of common application scenarios using a data-driven test approach 

More specific, the student will learn

  • Recording test scenarios in Boozang
  • Automation lists and form fills
  • Handling waits and timeouts
  • Highlighting and reporting visual bugs
  • Building conditional logic using groups (if/else)
  • Extracting data from the application

Meet Your Teacher

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Why Test Automation Boozang: So why do test automation and why? I learned it well. A new project, right in software development. We have a lot of projects transitioning into our Giles and even more so in continuous integration where we have to push new features very rapidly, sometimes as often as many times a day. As an example, let's say we have unequal MERS website and we just updated the discount system. The developers will tell you that everything is fine detested the discount system. But as we know when software development, if you have experience from that process, when you touch one system, everything is intertwined and anything could break. So ideally, we would need to test through the whole e commerce website to make sure nothing broke. Now, of course, we could have a room full of developers sitting, clicking through use of interfaces, adding stuff to the court, making sure that the purchase goes through. But of course, this is really boring work. It's costly, time consuming and not very practical, even though it's been known to happen this way in many companies. Wouldn't it be better, though, if we could have a piece of software that would just test the software for you to make sure it works and let you know if it works or not. Without human interaction. Well, that's where test automation comes in. And in or example, Boo sang. In our example, we will take a knee commerce application and do some simple tests, and in an afternoon we're going to go to some advanced logic, and you're going to learn to basically automate all these flows to create this situation where you don't need a human testing for you and in or example, we are using an e commerce application. But of course, you sang would work for any software that runs in the browser. 2. Signing up: hello and welcome to this Booth sang introduction. The first thing we will need to do is to sign up for the booze on two on. It's fairly straightforward. You could go to our home page booze and gone home and just simply click on, Log in here or sign up for free eso. If you click all for a sign up for free, you'll be taken to a place to insert your email, and it will send you a confirmation email. So, of course I'm already, uh, a signed up, so I'm just going to go to a I don't who sang dot com and here I can just go ahead and log in. So basically I will put my email address that I used to sign up and also a password. Of course, I have a Lord off projects already, but what we will do now, because we are going to use the lab, I'm gonna enter, create new project and entered the lab on. I'm basically just going to click launch here. It's very important that your because you don't have the option off adding the X html fragment to the lab, which is or aside when you click Launch tool here. It's very important that you do that using chrome so you can use the chrome extension. So basically, you just click on the download link right here on. As you can see here, you'll just go out to chrome and it will be automatically added to chrome. One word off. Warning. If you have lord off different extensions here, like form feels and other things. It's recommended that you either disabled those extensions cause they could conflict with the chrome extension. Or that you'll make sure to run The boat sang ia a i e cognito moved where the other extensions aren't running and you can run the whole two in equal Nitto mode. So now when we've added the extension, if we actually refresh this, it shouldn't prompt us for the extension anymore. So instead, what is gonna ask us for four is to a add or first environment. So this is where we could have one. You're ready for development. Like local host, you can have a que way environment you could have staging, you know. So for us it would be, for instance, staging dot booze and dot com, etcetera. We can also support several application interfaces. But right here just now, just at http the lab, dr Suzanne dot com to get started. And you just click savior on what it's going to do with its going to directly prompt me to create my first module. So we're going to leave this for the start, But now you basically ready to get started testing? 3. Recording a first test: Now that we've signed up for the booze and tool, we're going to start by doing some really, really basic testing. So what we're going to do with, we're gonna create the more you called navigation here and the more jewels or to be thought about as ports off your application that are and isolated. So usually, for instance, when you have a hamburger menu or a big selection menu in a project management tool, you might have projects you might have users. All those things, like projects, users would be modules. And then you would have, perhaps operations like Add Project Elite Project. If you have unequal MERS application, you have a more ducal court. Add item to court, delete item to court, etcetera, and then you would use thes tests to build higher order tests. So here we're just going to do at the end of the day, validate links, main links. Okay, main knave links. So what we'll do with will just create a really, really, really simple test. And by doing that, what we usually want to do with we have the option off recording tests. We can add individual steps off tests here, and we can also write the tests, right. So there many different options. What we're gonna do mainly is using the record function and then you some smart ai logic to drive dating to these tests. So just hit the record button and then let's go over and just navigate through the link. So if you click on a link here, you can see that it's basically the navigates to that page on. As you can see, it's like this browser window is recording what's happening in this browser window. So what I'm gonna do is I'm just gonna add small navigations like this, Andi, when I hit this validate, it basically just creates an assertion on these items, right? So, as you can see now, ofcourse, I could do this for all links, but what we're gonna do is we're just gonna a stop here, and then I'm going to go and just run this test. So what I'll do is it will run from the action you have selected. So you've got to make sure that the first action is selected here. And as you can see, this was a successful test on, and we can see the report here being generated us successful looking. So if something would be wrong, I could change this, for instance, to say And now let's see what happens. As you can see, it's trying to validate this. And of course, either you continued the test and it will be generator failure or it gives us the option to try and be paired this test. Okay, so that's what it is. We're allowed to again pick out the element path again. We're going to go into that more later. But these are the basics you recorded with did some navigation and we did some validations or assertions. 4. Overview of the Boozang tool: Now, before we go into the details, we're going to go it watered. Orderly, right. We're going to go over how to record and do some cool tricks using the sorted list, unsorted list, tables, forms, etcetera. Before we go into that, I just give you a little overview off the tool. You have a main navigation on the left hand side. Here. You can see if you hover over it, you're going to see different sections, right? What? What we need to do mostly. We're going to be in this top link here. The navigation. And this is basically where we create or more dudes and tests in order to go and navigate in the tree. You used this talk navigation. As you can see, you could either click on these links or you can directly go into the different ones directly here. Right? So when there's many, many tests, it's easy to be able to jump between different tests and different modules. In here. You also have the tabs right on. As you can see, usually you have more jewels. You have data on the project level. You'll have data on the on the module level. But then you also have data on the test level, and the data is really, really powerful. And that's what we using. We try to make Waller tests Data River that would allow us to use the same test for many, many different test for many different cases and must be able to use and drive it from the outside from file data and see SV's. And as you can see, we support many different data types here. We're gonna go into that later on the left hand side. You also have so you can record bugs. Three. Idea of the bug here would be usually a something visual that you want to annotate and point out in the user interface. Under settings, you'll have many different things. You'll have the different environments. You know where you can set up staging production, etcetera. You have content policy. It has a Lord off more advanced functionality. For instance, you can create your own components, record them like date pickers, for instance, and then you can basically just feed and they can be recorded as one line. And that creates a lot of re use and makes it very, very easy to do. Advanced recording. Then we will have something here. Data for out to Phil will be used at the reverse of a regular expression toe out to generate data phone number. Address is this is also very powerful. Under the alias stop, It allows you to point out test cases using aliases. And this is very good. For instance, when you maintain your C, I continues integration server integration. Right, Because you can keep those, um, static, and then you can point to different regression tests. We also have a preference is section. This is for your you, sir, to be able to set your settings or personalized settings. And we also have a notification tab where you can automatically get email notifications for all test results. This is, of course, space it specifically useful when you're running or tool from command line or from the sea ice server. Here you have the report. This is your test report from the last test. You have tools where you can export and import your project. You have a big in just shows you your unsaved tests and also gather team tap. Last but not least when you have a problem and you need some help Use this question, mark. You can now get interactive hell by clicking on the different ah categories here. So this is a very easy way to get interactive. 5. Adding items to a list: Now it's time to get started with the real testing on the lab. So what we will do with, we will do a set of tests you see in the left menu sorted list on sorted list tables on form validation. And this is gonna teach us to do data driven testing. So in the beginning, we will start by doing simple recorded tests, and they were going to learn how to bind this into data to be able to create a lot of reusability between the tests on the purpose of this is, of course, to be able to in soft resin service interfaces where you have different functionalities, create project re yusor delete project to be ableto automate this and very, very beause herbal and smart fashion. So why I think you will see as we go along, what the purposes. So let's start by creating a first module here for sorted lists. And here, of course, I can create the mortal. I could put an entry level on the more your level, which would be normal. But right now I'm going to do it on the test level instead, a hadith them to list and here of course I can click into the list, but I can also put the entry. You arrived to sorted list directly in the test. So if I do this and I'll hit this green button, it's gonna change directly into the U. N. You can see that you are really sorted list right there. So, of course, the naive way of doing it would basically just toe ad a number off. Let's do real things here. Clean the floor needs to be done. This is a to do list, war the corn, and then you're gonna create a validation that these things have been added. So I'm just gonna create a validation on clean the floor. So I'll hit. This little validate here is going to create an assert equals for this thing. Wash the car, and then I'm gonna go ahead and delete them again. So now we should have a test case that does exactly this tests that adds the items tested, the items have been added and then delete them again. So it's a cleanup condition. So let's try this. Hey there. I'm gonna hit the top link, so it starts from the beginning, and I'm gonna hit the play button. And as you can see, it's a success. So now if anything would have been broken in this functionality, this would now have been failed. Right? What we want to do with create regression, test four functionality that should be working. But as you can see, this is very specific. I'm hard coding you can see in the code. Clean the floor, wash the car. Andi, if I would have to change this line, I would have to change this line, etcetera. So what we're going to do now is instead, we're going to make this a little more dynamic and a little more interesting. 6. Adding item based on data parameter: Now we've just created a simple regression test to be able to add items to a to do list, make sure that they're added to the list and then also delete them again. It's a very specific case. It's is great. This is what you would do with normal test automation record and replay tools, this kind of operation. But I'm going to save this. We're going to create a new test that is again at items to list. But instead we're going to do with parameter driven. And I will, uh let's see here, pull it. I done to list when they put it harassed like that. So what we're going to do now is again. I'm gonna go directly in the U N. Click there and put sorted list. And now if I think the green button that I got to make sure that you end up on the sorted list Now, you see, Yes, the entry, you really is correct what we want to do with. We want to kind of create something that takes parameter and that can drive this kind off thing using a variable. So what I'm gonna do is I'm one hit the court that I'm gonna hit buying the data. I'm gonna bind it on parameter level. You combined it on parameter level. You can bind it directly to a variable on the test level. More do level or project level. Right now, I'm gonna use a parameter level data. And as you see, it suggests something they're using or a reverse breaking expending. But you can actually just start typing, wash the car and hit, and you click on wash the car will bind it into a parameter, and then you will hit. Enter. So basically hit click again there and it enter. So no, If I stop this, I can actually play this. And of course, you're going to see what happens if I delete this. Okay, there it is. But now I want to add something else. I'll just go into parameter. And I ended the parameter here to feed the cat. And now suddenly I can go here. I can now add feed the cat so no in the matter. Off seconds. Right. We have now created a data driven the test automation case, which you can drive this with external data or through a data loop. So that's what we're gonna do next. But as you can see here in the orange, you see that it's a parameter that is being used. And here you can see the parameter. And then if you want to move with this into data, you can also save this into date on test module and project level. But we're not going to do that right now, So let's see now how we can use this test to drive. Ah, the testing from the data. 7. Adding items using a data loop: Now that we've created a test that could add lists based on basically a parameter that we're sending into a test case Now we can create another test case that drives this test case and feet it with data on what this would allows us to do is basically create the small atomic test case units that will be very, very reusable and that you can use for many, many different purposes. So what I'm gonna do is I'm gonna start like this, cleaning up the list. So we have the original list and then I'm going to create a new test. The new test is going to be called Let's call it add items to list blue because what we're gonna do is we're gonna loop over a set of data. Then under test data, I will add the CIA's V five on the reason why we could use many different kinds of data. There's a lot of different data support in bustan, but what we want to do is we want to feed this, but that takes this test cases actually adjacent object because it has like a name and a value. So what we're going to do is if you loop over CSG every line off the CIA's, we actually represents a Jason object. So basically, what we want to do here is we're just going to call this items, for instance, right? And then we gotta make sure that this heading here corresponds to the value name that we feeding down into the test case. So I'm just going to save this, and then I'm gonna go back using this drop down to see what was the name of that parameter . And as you can see, the default is add new item. So I'm just gonna copy this and basically go straight back to where I were. So by doing this here, I've just put the heading at me, right, And I will call this, Let's say, washed the core. If I spell it correctly, it's better wash the core by groceries. Andi, eat more badger notables. Awesome. Right? So what we're doing is we're saying, Hey, let's loop over these rows off course. You could have many, many columns here and building more sophisticated datas and building basically a bigger Jason object. But here we only have one item, so it's only one column and when we do this will go into record would basically just say, Hey, make sure to do over these items so it's basically you can set the index start and end. But what were you just saying is loop over these items and then we were just gonna plug in the other test case, which means called the other test case will add items to list. And then in the parameter section we used to be served, he would loop, which basically means one off the rose that we feeding in there. So let's see how this is working now. So if I play this ideally, we're gonna call the test case three times and feed the parameter into the test case on. Hopefully, this will work as intended. So let's try this. Well, as you can see, I was running add items to list loop and it just ran the test case of one type with the wash the cars. I'm going to try again and see what happens. The reason why it did that, by the way, was that I highlighted the first action and it only ran that action. You need to make sure to highlight the start line off the test case. As you can see, it's adding everything appropriately, which is great. But what you can see is also keeps reloading the page. So when it reloads the page, it deletes the items because there is no memory in this set. So we're gonna just figure that out. The way we're going to do that is we're gonna tell this well to never reload. And then we're going to save this and we're going to go into the sorted list and also make sure that this one never really loves. So just select, never reload on the test cases. And let's go back again and see if it works. Well, as you can see here, we created a very simple test case that has a master test case that feeds data into another test case and allows you to dynamically add data. So this is a very good starting point. For instance, if you want a provisional system, but data create the number of projects Onda by building up test cases like this atomic lee , then now you can start creating very, very sophisticated test cases that can do a lot of cool stuff. But We're going to see that later in this exercise. But this is a good foundation toe. Understand? Data driven testing with Bouza. 8. Re-using sorted list test cases for unsorted module: now off course, there's a lot more we could do with this tool with the sorted list. For instance. Of course, we have this obvious thing, which is cleaning up the test case right using this delete function. But because this is very simple with the sorted list because it's completely predictable. Where the element will our end up, we're going to go over to the unsorted list straight away, and then we call it Illustrated. So we're basically up learning a little bit. The difficult level. And working with unsorted list is something that, for instance, a regular tool using class and I DS and Ex Path would have a very, very difficult time with. So what we're going to do is we'll go back, create a new, more deal called unsorted list, and then we're basically gonna create, although those tests that we need. So I'm going to start by creating unsorted lists, and then instead of creating tests now, of course, we can go through the same exercise. I'm going to try and copy over the tests are already have. So let's do this sorted list. We need our ad item to list para. So what? I'm gonna do is I'm just gonna Here, go to the mall to you and make sure to copy these ones, right? I hit the copy. Bata Aunt, I'll go in tow. Unsorted lists on. I'm just pay stuff. So the good thing here is that, of course, if I play this now, it's going to go and play the sorted list. So I just changed issue around two unsorted list and we'll see what happens. Right? So what we'll do here is I'll play this and we'll see if it's unsorted list. And what you saw there is that, of course, I say never reload. So it's still under sorted list. So just double click here on unsorted list and see if that is the euro. Yeah, so now we now know that is going to run unsorted list. And as you can see, it adds to the exact same thing. But you see, add to list ends up in a random place in the list. No, we're also going to take or loop with us. So I'm just gonna again go to the module, copy the test case and paste it into unsorted list. And now off course, we will have or data driver s. Well, so remember this one is going to reference Had item to list. So you want off course? Change this So it's added item to list in the unsorted Lismore do otherwise we will call the other test case. So in go to test case uncle add item to list Haram And then I make sure that it's still looping over the same variables. OK, so I'm going to clean this up and let's see if it runs. I highlight the first rope and I click play and now we're basically duplicated a set of tests. But on the different you were wrapped and as you can see, the items gets added but they're added in a random place in the list. 9. Cleanup item in unsorted list: So now that we've added basically a loop that provision data internal sorted list, we also want to make sure to do, uh, the cleanup conditions may basically making sure that we delete the items after we ready. Right. Often you'll have create project, do a number of operations, make sure that they work and then delete and clean up afterwards. Okay, so that's what we're going to do. As mentioned before, one of the really difficult things is that it's an unsorted list. So if I add something into the list, we cannot predict where it's going to be Andi using X Path or other element selectors, this becomes very difficult. So with who sang not so much. And I'll illustrate how so what we're going to do it is we're going to start by creating a delete item from list. And we're simply going to go ahead and record, um, deleting tonight and so hit record on again. Remember, we're gonna use the entry your arrest unsorted list on. We're gonna remember Teoh not spending so well today. We're going to remember toe also not reload the test case the test window because there is no need so I'll just hit the green button here. We're back it unsorted list hit record and just clicked early. Now, as you can see, it's as click delete. Last buttons of the default behavior here is to just delete the lost thing in the list. So if we hit test two, we say something else. Test one. The problem is, when we run this, it's just going to delete the last tighter, so that's a little bit unpredictable. So what we're gonna do is we're gonna make sure that we believed by the identify here. Okay, so what we're doing here is I'm going to go in here and I'm gonna hit this ended button here, right? So I'm going to re select, Let's say this thing. We wanted to be tested three. But then we hit this ended button, and instead of using and contains delete, we're gonna use *** Test three. Now, we know that if I hit this, it's gonna delete test three. So that's basically an introduction to or don't picker. So if I hit this and now I can again go and say test three and regardless of where it shows up in the list, it's always gonna delete that. And I'm just gonna illustrate one more time. Ah, adding test screen Now it's in the middle and still it's going to delete that ICTR So this will allow us to basically provisional list off projects or whatever it is, do a number of operations and then clean up in an orderly fashion, regardless over the exact initial conditions in this list. So this is something very, very powerful, and what I'm going to do next is basically titles together where we'll run a big test case , do a number of assertions and then clean up. 10. Creating a data loop with cleanup: So now we basically have a test case that you can add items. We also have, ah, cleanup test case. But we want to make sure that also, this test case takes the same parameter as the one we asked. Like the ad item to list right on off course. We could do that by simply adding here manually in the set parameter or using the data buying function you have here. But there is actually in this case is simply a way because we want to make sure that it looks exactly the same. We're just going to go into the ad item to list, and we're just gonna copy the parameter over here from the parameter window, and then we're going to go into delete items from list. I'm gonna paced back the parameter here. No, as you can see. Okay. Here it takes the same parameter eso. That should be a good thing. But the second thing we want to do with, we're going to remove this hard coded test. Three button. Right? So what we're doing here is you see how we can click test three here? Now it's going to guess that Oh, perhaps you want to use the parameter here, so I'm just going to click on that. And suddenly we have created a data driven test case and let me show you. So here we have test one. Test two, Test three, Test four. OK, No, I'm basically just gonna set the parameters here and say, Let's delete I've them taste one. No, this should work and know that. Oh, he wants to delete test one. So let's try that. As you can see, it takes the parameter on deletes the right item from the list. So now off course, we already to create a data, Lou, that basically adds the items on. Deletes the items as well. So let's just plug the test case here. That is unsorted. Least delete item from list. Make sure to send the loop in the parameter and let's see what happens. As you can see first, it adds the wash core and it cleans up after it. It adds the price groceries and it cleans up and it adds to eat more vegetable. So now basically, we have a monster data sect of a number of items. We have something that adds the item and we have something that deletes the item. Onda Um, that's about it, right? That's a very good kind off provisions and clean up. So it's just a way to really quickly build very reusable test cases for adding and removing things in a list. 11. Adding validation condition to loop: Now you have test case that basically takes a set of data prohibitionists into a list and uniquely deletes that item from the list again. Of course, we're not really testing anything except the ability toe add and delete, basically making sure that these things are being done. So what? We want to do it as well. I think it's to add an assertion in the middle of this to make sure that item was added into the list. So what we'll do is basically I'll create a new test case and it's just called validate. I, um I did. So what we're going to do is we're just gonna hit the record. Andi, again, I forgot. I always forget to change the Europe. So what we're going to do here is we're going to click on the your evidence, say, a new sorted list, and then we're also going to say, Let's not reload this never been so so now hit record. You can hit this. Validate here. So what I'm doing, basically, I'm creating a validation that cuddle with cats is in the list. So as you can see now, this validation is gonna van today. True. If coupled with Cater's in the list on If it's not in the list, it's going to validate falls. So then we're basically going to be able to say, Hey, this should go to success If all the items are in the list, they're supposed to be and if not, it's gonna fail. So I'm just gonna hit this now. And as you can see, it validates true, right? And then I'm going to try and delete it and see what happens. You see, now there's a red thing here saying it doesn't find it right. So now I can basically just reload this Andi, run it again and as you can see, it's there and it's working properly. So the next step would be to say, Let's make this inter parameter So what we'll do with we'll go into one of the old things would just copy the parameter over, go into validate item added at the parameter, just like before and then change in the path off. The exist in, coupled with cats will hit on. I'll hit and contains add new writer. So what we're going to do now is I'm gonna make sure that if I put here. Add to list. This should fail, right? So basically here when I hit it, you see as it's read. And now if I set coupled with cats, let's make sure that I get this right with Cats. It should evaluates to True. So let's see if it does that now it seems to be working. As you can see, it's highlighting the item in the browser, so it seems to be working well. So that's title together will go into the add items to list Lou. I will plug in the validate item added. In between here and without the parameter again, we used to reserve loop Just so you see, they're all the same. Basically, resending the date that into that ad item, the valid item added and delete item from list and I will try and run this and see what happens. And as you can see while it's running, you're getting this little green check Mark Wright, showing that it's working on what we're going to do in the end is basically just look at the report and see if the test succeeded or not. As you can see success, 21 actions out of actions were succeeded and it was in total 12 test runs right, three rows up day, four rows of data with three different test cases so we can take a look at the report. And as you can see here, you can see that everything executed successfully. And if you want to spy into the parameter, you can just hover over this thing. You can see the different parameters to resent it. 12. Doing a form using static data: Now that we've gone over basic GAM data driven testing to be able to call a test case from another test case, doing validations very often in applications will have different forms. So we're going to create a new, more to hear called forms. And we're going to do, ah, a lot of interesting things, how we can drive data into forms and also do validation of dynamic data. So let's start by creating the forms module, and we'll just basic great fill a form static. So we're just gonna fill a form with static data again and its form validation. So I'm gonna put the u R L directly here to be form validation and then if I wanna, well, validation. And if I want to make sure that this is actually the right thing, remember to hit the green key here, and as you can see, it loads for invalidation or you can actually even just double click on the on the action. So if you're basically doing something, just double click on the first row when you have actions and you're gonna load it. So what we're gonna do is we're gonna hit record, and we're just gonna fill out this form mats. And as you see, of course, I can remove the buying data. It removes that dialogue. But as you can see, we can actually buying data into variables directly into the form. So of course we could do this statically where it says, Oh yeah, here is the label. So let's try that first and we put Sung and we submit this form. So let's see what happens when we played this. And as you can see, we've now created a static foreign field. But also my mistake. When I hit the enter key here was also recorded. So perhaps that's not so ideal, right? Cause I hit the enter button when I should have hit the tap, were just clicked on the next field. So let's see if I remove this, uh, submit, click this mistake and click that I did. So let's just go ahead and do that and then double click on the first and see if it's still executes. But it looks like everything is fine. It basically ran through in some cases here. Of course, if it picked up the path with these, everything's whatever just re record the test from the beginning. But as you can see here, just doing a standard form Phil is quite straightforward 13. Doing a form fill with dynamic data: No. We created a form fill right, something that feels a form, which is something you very often want to do in test automation. But it's not very versatile. We've found, with basic, created one test case that fills the form for this person, right, me on. A soon as you want to create something that fills the form with other data, you need to create a new test case, and then you'll have a lot of test cases. That's not what you want to do. So what do you want to do is you want to go ahead and create a dynamic form feel right that uses data. So what we'll do is we'll call it, fill a form from parameter, and that would use again the para meter space to fill the form. So we're gonna go ahead directly to say, Hey, let's see. And again, let's change this u R L directly to for validation so it goes straight into the right page . So let's see if that's the right page. Yes, it is, and we'll just creek record. And as you see you have buying data here, we're gonna bind it into parameter, so I'm just gonna enter the exact same information on every time I fill it. I will just click on this label, right that, as you can see, it now binds it directly into parameter. As you can see, we also suggest information from our reverse reggae expansion. That is pretty cool, but I'm just going to use my real information here. And as you can see, we've now created something that fills a form using dynamic data. So I'm going to submit this and press stop. So what we can do now, of course, is now we have something that just takes some parameters. We can call this I'm now James Hetfield, but strangely asked the same email. Ah, addresses me. I'm gonna go ahead and play this. And now, as you can see, it's going to use a different set of data. So now we have a very versatile A test case that we can do a lot of fun stuff with 14. Adding data validation: So now we have, ah, test case that Vince a form based on the parameters and that's a good store. But of course, we weren't really testing anything. So what we're going to do now, Just like the other test case, We're just going to start by adding and validation in the end. So I'm just gonna go ahead here on either on hit the validation here, or I can go ahead and just use this plus and just add validation, right? You can hear at on edit the actions one by one, or you can record them or at the validations or comments directly in the browser. So what I'm gonna do is I'm going to try and add a validation on top of this very dynamic field, right? That has a lot of different things. We're going to see if this works. So the first thing I'm going to do is is I'm going to capture it. And as you can see, it's using a lot off, um, dynamic data here. So we're going to see if this is working. Okay, this is working, but we see that in the path, The role some man pretty damning stuff there's hard coded my name and stuff like that. So what I'm gonna do is here. Instead, I'm going to try and end it this and see if we can figure something out. So I'm going to try and do is I'm going to remove the contains there. So it's just the cord body and select that. So now you see, there's no dynamic data in the selection, and we're going to see if this still runs okay? Yeah, it looks good. So, no, we're going to run the test case with the validation and see if it works. Okay, that's fine. We now have something that fills a form and validates the data. And, as you can see with automatically captured that it's these dynamic data, right that you're seeing. So, of course, to really, really test this, we need to change these things. I'm just gonna change this back to my name and see if it still works. Right. Then we proven that it actually does work. So let's try. So, as you can see, we created something that is working. It's capturing the the data properly. But what can we do with this? Right? Well, now we can start doing some interesting stuff. We could feed this with the data, Lou, so we could go over a number off entries into a form, for instance, Uh, but there's also some stuff we can do using our regular express end in, So I'm going to do that, nets. 15. Randomly generating form data: So just like we did before, we could, of course, do very sophisticated, different validations. We could go in action by action and change things, but there are some pretty funny stuff we can do. Um, simply right. Want to keep this simple? Um, and it's basically here. When you look at the parameters we are now using kind off a temporary paramilitary space, you can actually go ahead and save this directly into data, and then it will show up under the test data tap. So let's do that. Let's go ahead and just say, this is my user data. And now you see there's a checkbook saying the perimeter value will change test user data. This just means that the test will still run the same way. So if I close this, I go into test data on let's say I put here again. James Jeong grin and I played this test. It will basically I just use the data from the test top. So this is good right now. You have, like, temporary test eight that here, But when someone calls the test case, you could still override the date us. You have a default behavior and you can also send into the parameter and override the date that that this test case takes right, which is very good. I can do no test the test in itself and then I can use it upstream by other test cases. Right? So that means, for instance, if something big changes here, I can update the change and make sure it works, not by calling these upstream test case, but still, I can call the same test case with data and it will be overridden. So it's kind of like a unit test and then you can also use that in a bigger context. One more thing I want to show you before leaving form fills under test data here, we also have a way. Of course you can hear use. You can use JavaScript function to generate the whole Jason in user data under here, but we also have something very powerful, which is a rig X data engine. So if you go under settings and content policy, you can find a number off reverse reggae exp generators and they take feel the mapping right when we try to guess a password, and you can just enter all these things, and you can basically out to fill data. So instead of doing that, I'm just gonna use one of these now. So I'm going to use Let's say, I want to generate random e mails all the time. I'll just hit email and it's going to give you a reggae X peer. So now I can run this and just generate a new random email for every time I run the test case. Which is, of course, useful. For instance, when you have perhaps a unique email list, a unique I D. And you want to be able to create a lot of uses without hard coding, a number of I D. So let's just try this. As you can see it generated, according to the SEC ting that I specified here under settings Content policy, which is under E may, you'll see, the B said made right this regular regular expression. And if I go back, I can run it again, and I will get a different e mei for the use of and observed right how, in the validation it's still uses the parameter. So Stine it passes the validation even though the data gets updated 16. Autofilling forms using Boozang regexp engine: well, before I leave the form, fill it all together. I just want to show you some need functionality that we have that can really speed up test creation because we have this reverse wreg expending to generate data. So in this, you also have a field mapping. So here you can add we already pre populated prices weeks and what everybody's air just example. You would create your own attributes with your own field map ings, right. That would be perhaps a sip code, perhaps your address format for where you are, phone numbers and then you can use them. And actually, alto generate data feels so let's do fail form out to generate it. So this is just really how you can If you really want to create a test quickly, this is how you do it. So here will go ahead on just hit. Save on. I'll hit first. You'll hit here to make sure you go to form validation. You hit record, and then you can out to fill this form so either you're out to fill it with static data based on or regular expression engine and the regular expressions you've defined based on these labels here. First name, last name. Use the name or you'll hit buying data and automatically bind it into parameters. So we're going to try that on. As you can see, sometimes it's high. So try and hit it again that let's hit out to fill forms again and see if it can do all the fields. And as you can see, it fills all the forms with kind of gibberish data. But it's not really gibberish that, as you can see, it uses that for the e mail it uses to email former that we specified for the first name last name. It uses the name that we specified for the use of name. It uses there the use of name regular reggae X for the password. It uses the password regular expression, right? So now off course, I can go and stop this test case and just change the data in here if I want to. And I now have a data driven test case in basically one click right? So I'll try and just make sure to reload this page and I'll try again. So that's like a really, really fast way to create a data driven test case using or out to fill functionality. We can, of course, also say Okay, here I won't ah, post code, for instance. Which doesn't make sense. But let's try it and it replaces directly in the parameter with the regular expression, and we can now go ahead and see what happens when we run this. So it's really to be able to very flexible, probably be creating random data to create data that doesn't necessarily have to repeat itself and also to test and load em forms with a number of different data sets randomly generated to make sure that it supports a lot of conditions. So you can have a lot of fun with these things, But with this, we're going to leave form validation from now but will not come back to it perhaps a little bit later. 17. Speed game: Handling re-tries for dynamic elements: one off. The critical things in test automation is handling time. Selenium is notorious for being bad at waiting for buttons to appear on doing good. What we call render weights right when you are doing a test in one environment and everything is working perfectly and then things you deploy this to a staging or production environment where you have traffic and things are going slower and then the tests are unstable and breaking. That's why it's very important toe handle, timing functions, and we will do this in the next section. You'd be pretty quick, and we do that by illustrating by the two tests, speed and weight. We'll start by creating a timing module and that will create the test speed on as he's seen . I always change do you around, but we can actually end through the u. R L straight on the test case. I just always forget to do it. So when we now, when I opened this now and I'll double click here, it's gonna load directly the speed The game is simple. You want to hit start game, and then you wanna wait until endgame appears and click it as fast as possible, Right, Onda, um, this might sound simple, but in normal test tools, what you would usually do in a lot of them would you just basically do. Oh, we're just gonna wait 10 seconds, right, which is the max amount of time. And it's not ideal, especially not for performance. So we're going to try again here, reload this page, and I'll see what happens if you do a regular record. Well, now we would hopefully that if we repeat this game, it's gonna hit the endgame, Right? So let's see what happens if you don't do anything with Bouza. So basically, it seems to know where the end game but anus. So it clicks it before it appears, and this is not ideal, right? So what we want to do with Sobhuza isn't so smart, right? Well, we need to look at what's happening in the source code toe, understand what's going on. Okay, so we'll do inspect, and we'll take a look at what's going on when you hit s. So what we'll do is I'm just gonna basically select the the button here because I know it's there. And as you can see, you have a stop button already showing here. Okay, so let's see what happens when we hit start day. It just adds to show what class. So now we gotta teach book Sank. To be looking for this class otherwise is just gonna hit the button way too early, right? So let's do that going into the dorm picker again. So what I'll do is I'll click here on the endgame Plett and game gotten. And again, I'll hit that edit function. And as you can see, there is a number off classes here signified with a button. So I'll just do and hit this show class here and I'll hit the check box. Now you can see that it's trying to explicitly look for this class. So what we do is we usually look for not classes, not I DS Brooks saying is default to look for human language. But in cases like this, it's good to override the default behavior. So let's see what happens, right? You hit play. Zuzang hits the start game. Of course, we have to reload this red cause now it's already having the endgame displayed. So again, let's try and hit play and what you can see now is that Assange is hanging, waiting for the end game and basically retrying. But instead of waiting the full 10 seconds, it's basically just clicking 65 minutes seconds too late. So it's very fast as soon as this button appears to hit it right, and this is what's really good in Lausanne that makes it very strong is that it's very good to be waiting for an event, and as soon as it appears it can take action directly in the browser. 18. Wait game: Handling explicit waits: So now we basically been able to automate the speed game. How do you do toe wait for an event and then react to it? It's as fast as possible. Well, sometimes that's not really desirable. Sometimes the browser is really good at giving us information and saying, Hey, I'm ready. But then, in the end, behind the scenes, you'll have database inks that's need toe happen. And, you know, perhaps that Oh, that's, Ah, there's a process that needs to take five seconds for before you do the next event. So then you need to kind of have an explicit way to being programmed in. So let's go ahead and see if we can illustrate this using the weight gain. So basically, all these games are just kind off done to illustrate common scenarios that you'll find in a scenario. So, of course, here, and this kind of tells you the time perception, skill, the ideas that you hit start game on, do you hit? You show the endgame straight away. But if you hit it too fast, you're going to fail. It is not going to tell you how bad you fail, right, because we want you to count to five. So I'm going to try again. 12345 And you see it right there. You It's not a great score, but the idea is that you want to wait exactly five seconds. So let's see how Boo Sang handles this. Let's do Ah, reload Off this on record. Um, the weight gain 345 Okay, that's not so bad. But let's see what happens when we run it in. Bouza, naturally, boozing is going to try and hit the button. It's as soon as possible, right? Because just because I'm recording slow, you don't want to test automation tool to be slow. So here we got explicitly state that Oh, we want to wait for this event. So as you can see, you see, there is a little blue timer because I was waiting a lot. It kind of guessed that Oh, I think you wanna wait. You basically want to have a longer time out. So that's one thing that is built into the to. But what you want to do is you want to change this instead of the maximum waiting time, which is basically a time out. You want us a minimum waiting time. And you want to put this to exactly 5000? Um, milliseconds. So let's see now. Now you can see that the timers turned red meaning, Hey, we're waiting explicitly, and it's kind of a warning for you to kind of clean up these things because they could cause performance problems. If you have too many, right, You want to keep your automated test fast, But in this case, we do wanna wait. We want to be patient. So let's see what happens here. So now we press play and we see what happens with you, sang, and you can see it's gonna tell you that it's waiting, Andi, as you can see it in the retry interval, we now got 428 milliseconds above the five seconds. So that's is in booze on how you would handle an explicit weight. And this would be very good when you have a synchronous operations or databases that needs to sink, or something that happening behind the scenes when you're doing automation 19. Using the comment function to annotate bugs: Now we've done some brief things. How you handle time, intestine automation, right and in particular impulse saying you sing explicit and implicit weights. And also how to use the dorm picker to say yes. Let's wait for this class or whatever, right? There's also a different part of test automation, which is not kind of the automated port, but also the fact that you could use a test tool to point out bugs that a tester cease. So you have Basically, we could call it hybrid testing. You have a real tester going in and seeing stuff, but then you want to kind of report this. And instead of filling out um, what he called that a bug report steps to reproduce. Do this. Then do that. You can actually use an automated test to to do that. So we're going to show how that's being done. So we're going to create a new module called visual Bucks. So what we can do is, of course, we could create a new test. Ah, that doesn't really matter. We could do that, but we could also, if we want to, um, create a buck under the boat back moat. You but I'm going to start by creating a visual test to just illustrate the functionality. So what I'm going to say Yes. Um, let's call it point out Bugs. And this is going to be in the visual bugs. So I think it's called the Troll Bugs. Oh, so I got that wrong, so I'll double click this. And I just changed it right in the U ran here. The idea would be that a tester is going through something right in here. We're gonna We're gonna illustrate this with a city dweller that is not too familiar with, you know, animals. Andi. Hey, Made some labeling mistakes. So what? We're gonna go ahead and do it? We're just gonna record here. I'm going to go. We don't have to bind any data here, so I'm just gonna unclip this. So I'm just basically going to click this next function to see what's going on. Okay, Well, that's a sheet up. The last thing was an elephant. This is a liar left. But what this also seem quite right, Does it right. I think he got this wrong. So it's a little bit silly, but what we'll do is we'll just basically put a comment here and we just highlight what's wrong here and say, Hey, this should the cebr Us or C bro And then I just go ahead on and close this. Then again, I'll click next. Well, that's it. You're off. That's good. That's a meerkat. But now it says, this is a C brought. This is not good. So what I'll do is either I could create like a validation and I could say, Hey, this is wrong on Do you know that would be the automated test? But now, instead, I'm just gonna add equipment and saying, This should be leopard, right? And, as you can see, because I created a mistake validation, Let's just clean that up. So I'll go back and click close here. I'll delete this one while I'm recording. It's not a problem, right? And then I can go ahead and just click next again. Okay, so what? I know I hit next two times, two again. I can clean data. So now we have a test case, which is more like a what do you say? Like a guide for a developer. So instead of getting a bug report saying steps to reproduce. We can just basically go through this and he can again correct a Lord of the Bugs in any flow. So let's try it. Well, there, you see, this should be Seabra. He can very easily change this, and there's no need to have any documentation. We can point it out directly in the application. And then you could just basically click next here or click play, and it will continue through the workflow and point out the bugs. And then that's it. Right. So this way you can point out bugs directly in the application using this kind of annotation, Take me. 20. Reporting bugs and team work: Well, now we have, Ah, very simple way. Teoh. Be able to use kind of human testers to point out bugs directly in the user interface. Onda, you know, have let go over work flow. Say, here is a problem. It could be usually look and feel problems. This icon is the wrong color. This text is wrong, etcetera, right? So now you could go through when, say, for instance, this does not comply to style guide and do this very quickly inside the user interface. You single automated testing, too. But I mentioned before that you can use bag and there's one advantage of doing that. So let's say I create here a bug and this could be like ex some I D. And then it would be problem with Ella front style. But I think that I think the elephant looks just fine, right? I just want to illustrate what happens if you reported as a bug instead. So let's go ahead and just record something here and here. Of course, we want to use visual box again so you could just minimize that and put here visual drugs. So it's the same thing. You'll record the bag issue show. You'll basically just make this big and highlight the problem, saying, for instance, this and uh then should be sure, elephant. I should write this correctly, though en event should the bigger so the elephants should be bigger. So let's try and see what happens when I played this right, so I'll go ahead and play it. And of course, it tells me the elephant should be bigger. There was a difference here. That is good. Is that let's say I'm longer than here as just a visual tester and I'm no touching the regular automated test. I might only have rights too, right into this bag module. And the other thing you can do is that, um as soon as you say this bug report shows up, and now, of course, I cannot assign this or, you know, you have the different work flows here and say, Hey, assigned it to me on I'll go ahead and submit this. And what's gonna happen is that a link to this test case is going to be e mailed to the person's email address. So if I go in here and let's say I look for pool sang, uh, we should be able to see that there was a t are assigned to you. And it also tells you what was the problem. The elephant should be bigger right on. I can just click here open the TR in Boo sang so directly from Yuri May you can launch the tool and replay the bug. So it's just a way. If you have a deaf team who are not currently working in the tool, you can assign it to other team members. There are managed under team here, by the way on, You just hit play, and it was going to take you directly into the user interface and show you the bug. So it's just really a team work function that is pretty, uh, smooth when working in big teams. 21. Yellow or red: Handling if-conditions using groups: now that we learned about data handling and also speed and waits. There is also something that is a little bit particular to boost sang, and it's how we handle conditional logic. And the typical case you want to do is when you handle a precondition. For instance, you want to make sure that a user is logged in before starting a test. But of course, if the user is not logged in, you might want to run the Logan test case and not fail it right. But you could also have conditions like make sure to add an item until certain conditions happens. Let's say the next link appears to test pagination. So all this our example of conditional logic on it's very powerful in the book sang Tool. I'm just going to illustrate how it's done here, and what we're gonna do is we're going to create a module called conditional logic on If I can spell this correctly and never going to go ahead and create the yellow or red, which is the test case, we have to illustrate this on. It's fairly simple. If there is a red appears, you should hit the while you hit generate cooler, right? And if red appears, you should hit the red button, and then it's a success on if you hit, generate color and you click the wrong button, it's gonna tell you to sail. So we're just gonna go ahead and just record. It's just as we see it, Um, and we'll see what what happens. Okay, so I'm going to do record hit General Kohler, and then I'm gonna create an assertion, right? The validation on the word red, and then I'm gonna hit the red. Okay, that's great. So we'll be saying now, hit the right button, but not likely, Right? We've just basically said, make sure that red is in the picture. So what we'll do with I was gonna go ahead and of course, he arable success because we were lucky. 50% of the time Red disco, Mishawaka. And now we were lucky again. But just keep playing it. Eventually it's going to show yellow. And then, of course, it's not gonna work. No, I'm getting a lot of red in the role here, so let's see how they're finally, you know how when you flip the coin, So now, of course, it's going to say, Hey, um, read doesn't exist on. Of course it's gonna faII so you can see that failure right here. If you would go into the report, you're going to see a failure there if you run it to the end. So how to do with this? Well, in order to do this a little bit easier, we're going to switch to the graphical user interface of you, and then we're gonna go ahead and we're gonna add a group here. So I know this year, why is a little bit knew we were going to try it anyway. So what we're gonna do is I'm gonna at the group, and we're gonna add the validation inside of the group. So the first thing we do in the group now is checking if the validation is there. Okay. So, no, If I hit the plus, you see that the van today exist? Red is the first thing that happens. So what do we want to do? Well, will be typically want to do is we want to make sure that we click red. If if if this is correct that this asserts correctly and we click Ah, yeah, No. Otherwise, what we're gonna do is we're gonna move, read into the group as well. Just put it right here. And now you see, with validate if red exists, we're gonna click red, right? But then we're going to say hello here. If it's not correct, if it doesn't hit red here, we're gonna check the failed condition here and say, if no, we're not going to continue to the next action, we're gonna break the group, going to jump out of the group, and we're going to display success so we can actually customize all these success. Failed an error condition. Every condition usually means you don't find the enema. And then we're gonna add another group here. Are we going to say, Hey, this is what we call an endless group. This is the group where if this groups fails, it's gonna jump into the next group, and then here we're gonna add a single action where we hit the yellow button instead. So we're going to try this and see what happens. Okay, so let's see you click the 1st 1 and then we'll go ahead and will play this. And now, if you want to We can also switch back here and you can see the groups being laid out like this. You see the elves group with the yellow button on the validation with the brake condition, as you see there highlighted. I will not let straight try this as you can see. No, it managed to not validate. Read it was trying to find red, but when it didn't is still marked the success and jumped into the Els Group and hit the yellow button on Let's try again that it works for red as well, and as you can see, it found the red and you click the red button. So this is a very simple way and quick way to handle kind off. If Ellis conditions right to be able to do one thing based on the conditions and the answer and what you see in the interface and will so off course here by having these different customizable um, kind of exit conditions, we can also call other test cases and also make sure to say, you know, if this doesn't happen, if this fails, let's not break the test. Let's not mark this as a failure in the report, so this is very powerful 22. Robustness of tests and how to use AI repair: very often. When doing test water may shun, you will record a number of tests on then, especially with these kind of record replay tools, test maintenance becomes a really big problem. Basically, you'll record some tests and then the cold changes, especially if you base this on class and i ds, but also other times s. So we're gonna just see a little bit how abou sandals with test maintenance and also how it is with cold changes. So we're going to call this. It's called Domine changes here. So let's call this dome changes and then all the test just like it's called here scramble item. So let's call it scramble from them, but clicking to scramble items and you see it's called Scramble. So we'll just change the, um to scramble ideas, really to illustrate this with the having a number of items, and basically you should always click the lion item lioness success lion. But in its success, elephant button is failed. The problem is, if you record something than automation to, you can basically scramble the idea. You could scramble the class. You can scramble the content and you can scramble the order. So now Of course, this is success, and this is fail. So it's just illustrate How would a test automation tool be ableto handle these changes? So let's see how boots and dusters. But first of all, what? We're gonna record the test where we hit the lion button, okay, and we're going to make sure that we don't reload with this, so it's better to do. Don't reload. Never reload this one. In this particular case, we could put never reload on your brand mismatch, but doesn't it doesn't matter. So, as you can see and who sang finds the item even if we scramble the water off course, Uh, that's not strange, but let's see if we scramble the i d off the button. Right. Well, it looks like Sang still finds it. Okay, let's say we scrambled the class, Okay, So if so, this is one of the advantages of not basing your recording on idea in class, right, Because when it's dynamically changing, the test remains stable to these kind of code changes. Now, the problem is, of course, because we are apple sang, we usedto the natural language. Of course it was scrambled the content off the element Puma. Right now, Bouzanis is not gonna be able to find it. The advantage of doing this, though, is that of course now, because we know what we're looking for, we can no actually say, Do you want to switch to a I repair mode so we can add automatically repair the test, So let's see how that's done. Well, it just shows you a dialogue and you're allowed to read Pick the element. So as you can see, we picked now the Puma button and we can continue the test. So as you can see now, we can scramble the I d and class again on the water, and it will still find the butter. So this is a way to if you're cold changes the tests will remain stable in bustan and if the actual text changes, then you can very, very quickly repair it. 23. Repairing a multi-action tests using AI: what? As you could see, it's pretty quick to repair tests in Bustan. Um, is this really to keep down your test maintenance and make sure that when code updates are happening, your tests are stable and when the actual wording or other things, or or there are big changes that you can quickly repair the test? Right. Uh, we're gonna illustrate this with one more a test which is called the multi scramble. So we're gonna do here, we're going to do multi scramble. So let's see. I don't remember this. U R L Salgo win and click on multi scramble and it's basically multi scramble. So what I'll do with and make sure that it loads the multi scrambling here. What we want to do, of course, is that we want toe hit a number off items, so we want record. Add kangaroo on. We want to make sure that kangaroo is added. That's what we could do is of course, we could create ah on assertion saying kangaroo added, And then we want to say really click, delete Kangaroo and make an assertion that the kangaroo was deleted would do at Kuala. Make sure that the call I was added to leave Kuala, uh, etcetera. Right. So we'll just do this throughout and make sure that when we when we hit this buttons that we're hitting the right buttons, right? So you just do that by recording the button click and doing the validation. So let's play this. So this, in case would be like create project makes your product was created a delete product. Make sure project was deleted, etcetera. So this is a very common, complex test case, but let's say no, we change. Add to create you see all the buttons. Now we will have a serious of buttons for ad is replaced by creating what would happen in Blue Sang. So what we're gonna do is we're gonna make sure that we don't reload this test case because then we lose or change. OK, and we press play what's gonna happen? Well, it can't find the ad kangaroo. So the hit repair and then it's gonna allow us to re select the battle. And as you can see, boots on has some intelligence with suggesting for us create kangaroo. We could either re pick, ended the pick or just continue with the suggested button, but we're going to continue with the suggestion so we'll do continue. As you can see, it understands now that ad and create or the same words with automatically updates the whole test case, as you can see, click, create caller click, create dolphin etcetera. So just by using the natural language, we are able to do some pretty smart things. Let's say you have created project. We can match that with add project. You have delete project we could master would remove project. Of course, we will be waiting for the user to instruct, Exciting to do so, but that allows you to also speed up test maintenance and make sure the tests run stable on you know, are cheap and easy to maintain. 24. Extracting and using data from application: Now we're going to go a little more into using data on Daz we were doing before with list tables and forms. There is a more advanced data handing you can do. One thing is when you want to extract data from the user interface, let's say you create the project or a yusor, and you need to have, like, the product idea user I D. And enter that into the search field. So what you want to do is you want to extract something from the user interface, save it in your test tool and then input it. So that's what we're going to do now. So we're going to do this by using this. Let's call it using data more to you. And then we'll create the test case called Corn Cat Strings. And here the corn cat strings is basically just using that. You're welcome Kat strings. So we'll put it into their The game is simple. Uh, we have to generate two strings and extract. I'm enter them together, illustrating that we have to use, of course, so that's a success. But they were put Cola bunga instead. The test is gonna fail. So what we were going to do with booze. Sang is just again, as usual, reload the tests with at the beginning, and then we can make this window a little bigger. We'll hit the record button with it, generates strings, will type the strings together, just as you would and will hit, submit. And if we want, we can also create a validation on the success that right showing that. Okay, this is a success. Of course, this won't work. It will only work for the bird barrel. Right. So now if I hit play now, we get something else we put again. Bird bear. And as we can see, it validates to failure. Right? So that's not ideal. And, of course, we can see in a report that we get ah, get a never here in the report. Right. Well, now what? We want to do this. We want to try and extract this from the user interface. So what we're going to do, it's gonna manually add the extracted data action. So we're gonna extract the elephant, and then you get some instruction saying is in the test T and P value. Okay, let's do that. And then add another extraction for the other one. So that's great. Except that if you look at the path here, it's looking for elephant on a lion in the path. So basically, if we run this now, you can hit the little green button to run this. It's gonna work Fine. But if we have to others strings like bird bird and you hit here, you see, it's not going to find it. You can see it doesn't highlight in the user interface and you get a little red triangle there, so we're going to be a little bit smarter. So we are going to use the set. Don't selector again and select that element. But instead of looking at the contains Elefant, we're gonna look at the class. So as you can see here now, we're looking at string one. And here, of course, we want to do something similar. But we don't wanna look at that will do the same edit. And now, instead of looking at end, contains we look at string to now we are district discreetly looking at those strings. So now we can go in here and say test TMP value and one thing you will have to remember is this will actually, right? Testy and P value is that here you will have to use the double curly bracket to make sure it's a variable. So let's try and run this and see what happens. Well, it did figure out that it's an elephant, but what didn't we do? What we assigned the TMP value to their element, and then we assigned it again. So we overrode the TMP value. And what we want to do is we want to come catch in eighth. Um, right. So instead of doing equals here from programming, you do plus equals that will add the two things together. So let's try it again. So, no, it should be able to extract the data. And can captain ate them. So you see, it works for lion elephant, and it also works for Lion tiger. Right? So this way you can use extract data and the don't picture to make sure that you can extract data from the user interface, and then you can use them, save them in the variable Andi used to Madeleine later time in the test, or create very, very good dynamic behaviors 25. Playing collecting kittens: Now it's time to conclude by seeing if we can teach Boost sang to play a simple game. So we're going to create the module called games. And then we're gonna go ahead and I'm gonna call this kid, then collect. So it's a game to collect kittens. And if I remember it correctly, do you relish kid done kulic. So let's see. Not Kitty Kit. Then collect. So again hit the green button and the game is very simple, right? The'keeper's air runaway. You gotta basically you hit start day. You gotta collect as many kittens as UK can in 30 seconds. And if you press ahead, choke it's game over. So try and get as many points as possible. So how do we do this in Boo Sang? Well, we're gonna use the conditional logic that we learned from the previous exercise right with General, Read the Captain Dog, and I'm going to try and see if we can kind of use this in combination with the loop to play the game to the end and get as many points as possible. And of course, this is useful to understand how can you react on things that are happening in your application to drive the logic off the tests, right? So let's let's see what we've learned. So let's start by hitting the record. But also, what is the first thing we want to do when we want to make sure Because we're going to do a loop that we don't keep hitting the start game buttons. We're going to look for this message here. So the first thing we're going to do is create the validation for the message, and then we're going to start recording hitting the start game button, right, and that's great. And we're gonna try and hit the cat. So I managed to miss it. It that So Now you see Click Cap, and that's good and this one is basically useless. I missed the cap, so I want to delete that right, so this is all good. And then we basically want to wait into the end of the test case to look for this game over , which is when the time has passed. Okay, so now we create the validation own game over and that's basically the base that we need. It's the first thing they want to do is to say we only wanna click start gain if we have this text. So I'm going to change to the graphic an interface and I'm gonna add a group and we're going to do what we learned before. I'm gonna put the validation condition in and the start game conditioning and make sure that they are the right water. First you want to validate, then you want to start game in here. You want to use on the failed if you don't have the text, break the group, right, so that's all good. So now we've handled the first condition. Then on Click Cat, we want to make sure that if the cats aren't shown, we wanted it's very random how they show up to want to make sure to wait for a maximum 10 seconds for a cat to show up, for instance, right, And then here at the end condition, we want to say, Oh, yeah, if you see game over, we exit the test case right. But by looking at, if it's failed, we can actually go back to the beginning over the test case, which is kid and collect. So that would basically create a loop and loop back. So off course what we want to do is say that this is normal. This is success and then this limit loop. This is like a security look, but we want to make sure that we at least go back perhaps 1000 times. Because, of course, eventually game over will show up. So now let's try this and see what happens. If we play this, I'm going back to the graphical user interface and we'll see if we can play this game. But it looks like it's clicking cats right, and then it looks like it's going back to the beginning, so this is a good start. We are collecting kittens, but we're not getting a lot of points. I would say a human could probably out do this test tool right now. It's basically it seems to be waiting very long here to look at the start playing. Then it clicks a cat, but then wait a long time to find this game over. But technically, as you can see, the tool is playing the game and that's great, waiting for a lot of seconds now for cats to show up and there it's gonna find and go on here also a little bit. Broca. So here we would like to do stop and make sure that if it doesn't find this cat, it's got to make sure to be not an error condition. So I'm going to fix this now. So here, of course, we're going to say, um, brake test case. We can just do continue to next action. Actually, Andi, just display a warning. So that's fine. The problem here, I would say Yes, a little bit slow. So even if I run this from the beginning, we're not really collecting these kittens as fast as we can, so that I would say it's the next tuning that we're going to do. 26. Performance tuning: Well, now we created a simple test that can collect kittens. Now, we're going to see how can we do performance tuning on this to make sure that we collect the kittens a little bit faster, right? To start from the beginning. And we'll analyze a little bit what we have here, right? So one thing is we have this validation condition, right? This we don't really have to wait for because we coming back to it in a loop. So we're gonna hit this little clock, and we're going to say, Wait, maximum 50 Miletic seconds to for this thing. And as you can see, there's a blue delay timer that shows up, not a red one. We're not forcing the way. We're just if it doesn't show up, we just skip over it faster, right? And then the click cat. That's fine. We're already customized that. And then, of course, on game over, we also don't wanna stay here too long. So we'll hit the blue thing. And now we're gonna get a blue timer that says we wait the maximum off 50 milliseconds right now. I'm going to run this and I'm gonna play it play and see how many kittens we can collect. This is basically a way to just performance tune your automated test, right? It's very important that it's good to wait in order to make the test stable in case it takes a long time to reply, right. But in certain cases, when you know the behavior, you can actually program explicitly change these delays on really tune up the test. And, as you can see, we collecting many more kittens now, right? This is six points. And of course, if you work with this and really look at it, you can be able to get us down to think we can get us many ass 12 13 points by working with the test case. So this is just a little bit how you can use the timing function when you know what's going on to performance, too, and also how you can only with five actions here actually create. They're a full test that will be able to play again. So I think that shows a little bit the purpose off using conditions and timing functions to be able to create really powerful tests