Quality Assurance for Beginners - Learn Automation Software Testing | Victor Gorinov | Skillshare

Quality Assurance for Beginners - Learn Automation Software Testing

Victor Gorinov, Automation QA and Programming Instructor

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
13 Lessons (1h 58m)
    • 1. Welcome

      1:05
    • 2. What is SDLC - Software Development Life Cycle

      6:51
    • 3. Agile Methodology

      8:20
    • 4. Software SCRUM Team Members and Responsibilities

      6:16
    • 5. Selenium Automation Introduction

      0:52
    • 6. What is Selenium

      4:00
    • 7. Create First Project and Install Selenium

      4:14
    • 8. Write Your First Automation Program

      9:00
    • 9. Use NUnit for Your Testing Automation Framework

      9:33
    • 10. Assert in Selenium Get Page Title and Assert the Result

      9:42
    • 11. Element Selectors ID, ClassName, XPath

      22:26
    • 12. Facebook Automation Program

      35:08
    • 13. Thank You!

      0:25

About This Class

Start Learning Quality Assurance TODAY!

★★★★★ "This is one of the best QA software introduction courses, the instructor explains the testing concepts clearly and concisely."

★★★★★ "Great automation tips and tricks, definitely worth it!"

★★★★★ "Useful, in-depth walkthroughs. Instructor is knowledgeable, genuine and speaks in a calm, paced manner."

★★★★★ "The best course for starting out with testing software. Every beginner QA should watch this."

★★★★★ "Thank you for this useful information! This course is easy, not too fast and not too slow. Everything is explained clearly and to the point. I recommend this course!"

★★★★★ "A good beginner course for someone who is looking for a QA profession. Very nice presentation!! Thanks."

******************************************************************************************

You will learn different ways of Software Testing and everything you need to start your first job as Junior Automation Quality Assurance Engineer.
This course will give you the foundation and confidence to enter the IT Industry as Automation QA Engineer.

You WILL Learn:

  • What is Selenium in Automation

  • Create your First Automation Project with Selenium

  • NUnit Automation Framework

  • Assertions in Selenium

  • Element Selectors - ID, ClassName, XPath

You don't need any experience to start this class, you will be guided step by step through this course .
You will also get Bonus Materials to help you from the beginning.

This course requires work in the beginning - just like any other thing in life.
But the best thing in the world is when your start making positive changes in your life.
This course teaches you the simplest way to enter the IT field - Quality Assurance!

If You Are Someone Who:

✔  Want to Become Quality Assurance Engineer

✔  Want to learn Software Testing

✔  Want to Change Career

Accept the challenge and get started!

You will also get:
- Support and Answers to All Your Questions During the Course

Now go ahead and start with the first lesson, I will see you there!

Transcripts

1. Welcome: welcome to this court officials and automation tasting course where you learn step by step , how to become a K engineer and start our first job in the I t field. My name is Victor, and I will be your instructor for this course. I am Automation can engineer and I have been working for big companies for the past few years, and I'm also a passionate instructor who wants to share his knowledge. I have designed this course for anyone who wants to become a K engineer, and we will start from the very basics. We will learn the basics off the software interest industry overall. After that, we will cover the basics of programming and we will start automating artists. So you're someone falls toe, become a K engineer and doesn't keep any experience these courses for you. You don't need any experience to enroll in this course. You just need to be open minded in training to learn If you're ready to learn, take action and start now. I thank you for your time, and I look forward to see you in the course 2. What is SDLC - Software Development Life Cycle: Hello, everyone, and welcome to the course. Once again, I want to start this first lesson by explaining what is the is the L. C. Or software development Life cycle. And the software development Life cycle is a systematic process for building software that ensures the quality and correctness off the software built is the Elsie process aims to reduce high quality to produce high quality software, which meets customer expectations. The software development should be complete in the pre defined timeframe and cost. And basically, the software development Life life cycle is just a process for developing software. And you may be asked this question if you're going toe interview for a junior developer, key engineer, and basically the whole process starts with requirements. And if you're a customer, for example, until you want a website, you're going toe to this company, which is creating websites, and you're telling them that you want to create, for example, this website like you did me. You want to be ableto applaud courses and people towards them and to leave reviews and comments and to be able to purchase from your website. All of these is the requirements. So the customer, the client comes with his requirements. This is the first face off the software development life cycle after you have older requirements from the client and you know what exactly you should be building as a software product. After that, the design faces coming into place, and this is the face where the U A or the U X designer on the front end developers or create are creating the design or how the Web site or the platform is going to look like they're building the design and they're giving it to the client. The client is giving his feedback, and this process may take a while until the client is satisfied with the final version off the design. And the after that, after we have older requirements and the design is created in the client have approved the design. After that, the next face is the implementation. This is where the developers and programmers are starting to coat the the actual software after the coding after the after the some functionality is being developed and this ready for ah, they think here it comes the next face. After the implementation of the software has been done, it comes time for for us a secure engineers or software testers to taste the software or taste the functionality that the developers have been creating. Usually during this face, we find a lot of books or defects, some things that are not the same with the requirements that the client have given us in the body beginning and the in the tasting face, we may give something back to the develop back to the developers, back to the implementation face. When it's ready, it's coming back toe tasting. If it's not okay, we'll bring. Bring it back to implementation. When it's ready, it's coming back to tasting and win. The key engineers testers are saying that everything is okay and dysfunctionality. This product is ready to be delivered to the client. Then we give this product to the plant when when the product is actually created and tested . And it is what the client have Bean asked for in the beginning. Then we give we deliver this product to the client and after that comes the final face, which is evolution or or maintenance. Basically, after these face, we're just making sure that there are no problems in the client care can use Hiss product, and I want to show you another picture, which is basically the same thing. But with other Graf, I want you to I want to make sure that you understand this is very important because this is the foundation. This is how all the all the big companies, the big outsourcing i t companies are working. And you need to know how everything is working, how everything is connected because we're not working alone. We're working in a team always, and you need to collaborate with everybody and to be on the same page so we can deliver the best product possible for the client. And again, the first face, either requirements the client is coming to us in is giving all the requirements and it is giving us older requirements about the product. After that. Ah, the design face start. It's starting. Cantor. The designers are making on the design for the Clanton after he approved the design. Uh, we're starting to create the actual project. This is the implementation face or the coding off the project. This face is done by the developers. After that, we're coming to the tasting. This is our job as a K engineers were testing the product, and if everything is OK and after the product is has been tested and it's approved by us, we're deploying the product of production, and basically the clan can use the product and from the final face is maintenance. We're making sure that everything is working as expected for the next months, and the client can use he's software. This is basically it. This is the software development life cycle, and you need to know this. You need toe. Be aware that you're going to work with other people and who is going to do exactly which face off the development. The final goal is to create the software, which is in line with the requirements that we get in the beginning from the plant, and everybody's going to be happy in the end. So if somebody is asking you this in the interview now, you know what is the software development life cycle? I hope that was useful. Now let's continue with the next lesson 3. Agile Methodology: Hello and welcome to this video. Now we're going to talk about agile. So what is agile? If you look for agile software development into Wikipedia, you're going toe. Find something like this. I'm just going to read this for you, and after that I'm going to explain it with my words. Agile software development is an approach to software, the development under which requirements in solutions evolve through the collaborative effort, off off self organizing and cross functional teams and their customers and users and users . It advocates adaptive planning, evolutionary development, early delivery and continual improvement, and it encourages rapid and flexible response to change. The term agile was popular popularized in this in this contact, the term agile was popularized in this context by the manifesto for agile software development. The values and principles exposed in this manifesto word derived from the underpants, a broad range off sort of software development frameworks, including scrum and kambon. So to explain this in a shorter way with my own words, I would say agile is a set off principles and values, and the aim off agile is to create a better software. The actually the aim off agile is to be ready for for changes in tow. Update things to get feedback from the client as soon as we're ready to give something to the clamp so he can give his feedback right away and we can improve things and this is the whole concept off our job. The whole concept is to be Toby agile to be quick, to improve things, to become, to become better and better every day, to live us to deliver software fast so we can get the initial feedback from the plant. And basically, that's the principles and values in order to create better software and to deliver faster software software, probably you have heard of Scrum and Cambon. These are the two most popular frameworks off agile, and I have been working in scrum and Cambon teams and I know are the benefits off off both of them and the The main difference is that in scrum, you're working in into sprints, so basically you have a user story or or remains a functionality that the team is going to create. And um, we're estimating this functionality with store IQ points. And, uh, for example, our sprint is going to be two weeks, which means that we need to create this functionality for two weeks. You have a time frame for which you need to create this and you're working into sprints and teach Sprint. You're delivering something to the client. A small portion off the software is being delivered every week or every two weeks, depending on the length of the sprint in Canberra, you don't have a time frame to deliver something to the plant you're constantly delivering . So you you don't have springs like one week or two week, two weeks. Everybody's taking something from the camp on board as soon as he is ready, working with something else. So if you're a developer and you you have a task, you finish your task. A soon as you're ready with our task, you're going to the board and you're checking wallet. Is that next? Think with the highest priority and you're taking that and start start working on that so there is no time frame. For example, we want to deliver the specific think for one week you're working on something, and when it's ready, your stand starting the next thing which is in line and that this is basically the the difference. I like scrum bitter because you know each day what exactly you're doing and how much time Hefford for it. But both of them are great ways for developing software and the also the base off agile and the the foundation off this methodology toe. To be flexible and toe improve yourself and your team every single day comes with some meeting since some things that have been proven to work well. One of these things is a daily meeting daily stand up meeting with your whole team, for example, what we were doing in my team every morning, 10 o'clock in the in the morning. We're having a daily stand, the meeting and everybody's telling, and everybody's explaining just for one or two minutes. What is he working on? If he have any problems, have any blockers? If he needs help with somebody else from somebody else and what is he? What he did yesterday? What is he doing today and what he's going to do tomorrow? And the the point of this is to give everybody on the same line so everybody knows his colleague. What is he's calling working on and when something is going to be ready for tasting for, for example, so they'll stand up. Meetings are really important and really helping with development, developing software and having a better communication with your team. Another thing. Kiss if you're working, working in on scrum, agile scrum, met methodology or principle in the end, off your sprints or Indians off your week or two weeks, you have a refinement refinement meeting where you are talking with your team. Basically, during these 12 weeks during this print. What what? I have been working good. What he had been working well and you want to continue doing that? What was not working well, what you can improve and if you have any, suggest suggestions for the next week for the next print and how you can make the process better. This is agile, basically in towards making everything better every single day and improving in the delivering faster software, getting feedback and just constantly delivering better and better software in the yeah, there is agile. Basically, you care for daily stand the meetings when you're working, working in agile environment. In the beginning, when your work starting work on the new functionality, you have a planning meeting where you're creating tasks for everybody. So everybody knows what exactly he's going to do this day, tomorrow, the day after tomorrow, how much time he has for this task for the other task. And basically, for the next one week or two, you have a plan, a written plan that you need follow and you need to execute. And this is really helpful because you're not wondering what exactly I'm going to do. You go from, Where should I start? You have a planning meeting where you're talking about these things and making sure that everybody's on the same page. And in the end of the sprint, the refinement meeting when you're saying what went well, what when bet and how to improve the process for the next print. Basically, that is agile set of principles into methodologies, toe deliver, better software and to deliver faster, too, and get feedback from the client in order to improve the software. I hope that was useful. Now let's continue with the next lesson 4. Software SCRUM Team Members and Responsibilities: Hello, everyone. And welcome to this. Listen, now we're going to talk about what is a scream team and what is the role off each member in the team? And the scrum team is a collection off individuals usually between five and nine members, could be 10 11 but between five and find is the typical scrum team working together to deliver the required product. And, um, when you were talking about this crime team, we're talking about the the scrum master, which is which manages the scrum process. This may be the project manager. He may do this work or you may have a project major and a scrum master. Also in this crime team there is, ah, developers beckoned and front end developers que engineers. So, uh, if this can be manual testing or automation tasting or both of them, you may have business analysts. This is the person which is taking all the requirements and basically making all the documentation and making sure that everybody understands the business point of view off the product. You may have architect, which is usually this is a really, really senior developer, which is which knows everything about the all the technical things in the technical stock, which is required for the product. For example, if the client client comes only with his idea and he doesn't know which languages are good for this pro product, and he just given idea, the architect is the person who is telling, For example, we're going to use Java for these or C Sharp is going toe to be suitable for this kind of project, and he's developing the framework and all the necessary taken cough things in the product. The product owner is part of the clients clients team. This is a person who is responsible for the delivering of the product until the product owner is responsible for looking after the product for extended period of time and is accountable for achieving product success. So this is the person who is constantly in in touch with the team with stakeholders and is updating everybody on how the the the product has been developed. And I know that this graph may see a little bit no for a little bit of too much for you in the beginning, so I just want to I have created this file for you. Just tow to have it is Ah, something a little bit simpler. Eso you may say so. The the scrum team, the team that is developing the product consists usually off a project manager, the person who is managing the project, who is creating all the tasks. All the who's creating the user stories, who is managing mainly everything in the product with contacting the client side of the business owner, the product owner and basically, he said, he's the link between the scrum team and the client Screw muster. This Maybe this role in my previous team was done from the project major. But usually this is the person who is making sure that everybody have everything needed in order to do their job. And there are no problems in the into the development in the problem in the product. The developers this This consists of front end and back, the beckoned developers. Next exchange nears. This can be manual or automation tasting designers. These are the people that are making the design of the project. This is early in the the early into the office after the requirements face, the business analyst is the person who is making sure that every everybody has the right documentation, the right requirements and everybody understands the business logic off the off the product and from the client site. There is a product owner, basically a person who is constantly in touch with the team with the Scream team and is asking how how is everything going where you're making demonstrations into this to this person and showing him what is the progress? And he's basically the person who is responsible from for the product from the client side and we as a cure. Engineers were standing here, and our job is to test the software to make sure that everything is in line with the requirements and were part of this crime team. I hope her that was useful. This is really and say essential. Before we start talking about testing and according to insurance, you need to have a general idea in the overview off how everything is working, what is the process off developed developing software and after that we're going to go deep into the into the quality assurance into tasting profession. But this is really important to to keep on overview off how everything is working because we are not working alone. We're part of the Scream team and the basically, this will help you if you know exactly what role and what part of the team everybody is doing. And if you collaborate with all of your colleagues, it would be much easier for for you to do your job. So I hope that was useful. Now let's continue with the next lesson. 5. Selenium Automation Introduction: Hello, everyone. This is just an introduction to show you how are coat is going to be Look a little bit later in this course. This is how are simple automation program is going to look like to log into Amazon. It may look a little bit confusing right now in the beginning, but trust me, it's going toe become really easy for you later on. In this course, this is just really simple program that we're going to run right now, which is going toe Amazon Web site and its logging into the application. So really simple way to show you what we're gonna be doing later. Don't be intimidated by that. I just want to show you how it looks like this is what you're going to be learning to do in the next lessons. So I hope you're this looks interesting for you. Now, let's start with the next lesson. 6. What is Selenium: Hello and welcome to this. Listen, where I'm going to explain to you what is selenium and what we're using it for. So selenium is, ah, software that we're using for testing quip applications, selenium, But by itself, if different components which contains selenium, I d e selenium are see selling and Web driver and selenium. Great. But we're not gonna be using all of these tools. We're gonna be using only selenium, selenium, Web driver. If you look what they say in Wikipedia, it says that selenium, like a state, is a tasting where publications framework that provides playback tool for functional tests . So what is selenium? Web driver? A Web driver is a weapon automation framework that lows you to execute your tests against different browsers like chrome in most of the cases. But you can execute your tastes not totally on from but against different browsers like Opara, like Internet Explorer, explorer or safari for ah Mozilla Firefox in the all kinds of brothers. The Web driver also enables you to use a programming language for creating the test cases in the distance scripts in the programming languages that we can use to create our tests with selling with driver are the popular languages Java Sea Sharpened Peep, Eitan, Pearl and Ruby. In most of the cases, people using Java and C sharp with selenium with driver, you don't need all of these programming languages. Of course, you just note you just need to know one on a basic level that you can write tests which exactly we're going to do in this in this course. So selenium with driver is a tool. It's a framework for automating their cases for automation tests. It's, Ah, you can out mate your tests on the different browsers against a against different operating systems, and you can use different programming languages toe automate your tests and you'll see when we start right our tests and writing coat that Actually, it's not that hard. It's not that difficult when you start to understand things. Basically, selenium with driver just allows us toe to create tastes, which are really similar with the what the user is doing on the brother. Basically, when a user comes to, though to a website, they click some things and they enter a password somewhere, they scroll here and find this button click on this button after that maybe they scrolled down, find another element and click here and that this is what we're going to do with selenium and with the programming language language that we're going to use. We're going toe simulate, simulate user experience. And what the user is going to be doing on the page and we're going toe have a final result , something that we expect from this test and depending on the actions and depending on what we have said in our assert, the taste is going toe pass or fail, depending on want what we expect in the end of the test, and I know that I know that this may sounds a little bit confusing to you right now, but when were we start to write our coat, you'll see these things are not so complicated. And so when you learn them step by step, you will fear fuel more confident in your skills. Later on, during this course else, you in the next lesson 7. Create First Project and Install Selenium: Hello and welcome to this video. I'm going to show you how to create your first project and how to reference selenium into your project. Basically, every time when you create a new project, you want to install selenium exactly for this project toe to reference the Selena into this specific project. So I have just opened my visuals to you. And the first thing that I want to do is click file New and Project because we want to create a new project. Okay, I'm clicking here on the console application dotnet framework, and the into the name I'm going to put selenium, selenium automation. You can do the location and stuff like that after that click. OK. And we have our project Selenium automation. Now, after we have the project created as I said, we need to reference selenium toe this project. So click on your solution up here on the top, right and right. Click and click. Manage new get package for solution. Now you'll see this market place from where you can install frameworks to your project. Now we don't see anything because it's generally clicked here on installed and we don't have anything installed for this project, but what we want is to click on, browse and search for selenium. Click enter. And the first thing that you're going to see is this selenium Web driver. Just make sure that you select the the most popular one with. Currently it's with $17 million. Just make sure that you don't click on the something down below like this one. For example, we want the selenium Web driver, which will be the 1st 1 with the most downloads. After that, click here on your project. It doesn't matter. Effect like you're on the name of the project or I click on Project Now is the same thing. And after that click Install. Now it tells me that it's going to make changes to my solution. And, uh, it's going to install selenium with driver version 3.1 for one. Okay, that's where that's what we want. Okay. Ah, selenium Web driver was installed. If I click here now on the references and on the arrow, I can see that the word drivers here So it was properly installed. And the there is one more thing that we need to install because we want to interact with the browser. We want toe our tests to make specific, specific interactions with the specific browser we need to install from driver to interact with the chrome browser. So here in the search box type chrome driver and again, we're going to be looking for the most popular $18 million selenium with driver from driver . Okay, Selenium Google from driver. That's what we want. Click here. Click on the project and click Install. Okay, and the chrome driver was successfully installed as well. If we click again on the reference and we click packages conflict, you'll see that we have installed two packages selenium, Web driver and selenium with driver dot chrome driver. That's exactly what we wanted. That's what we need In order to start start creating our automation tastes with selenium in C sharp. Now we can continue with the next lesson where we're going to start writing, coat and start writing automation tastes 8. Write Your First Automation Program: Hello and welcome to these video today. You're going to write your first automation program and it's going to be really simple. I'm going to show you how with really simple coat we're going toe out, mate. A program that is going toe Google and searching for something automatically. So the first thing Ah, uh, as you can see, I have opened our project here, Selenium automation that we created in the previous lesson and the I have zoomed this a little bit so you can see better. And the first thing that we won't do is to create a reference for our chrome browser and what we're going to do, because it's really useful. And I encourage you to do this every time when you write Coat is to write comments. Comments here in visual studio are written like this with two slashes, and after that, whatever you write is going to be considered as a comment. So it's not going to be executable coat, so we're going to type a comment here what we're going to do in the next line. So every time when they come back to this, we can see what is this about? It's really clear. Clear, but the program is doing. And if another person is reading your coat, this is really useful. So create create the reference for chrome browser. And the what did me that means is that we need to create a driver on and we're going to use home. So we're going to create a strong driver and we're doing things by I Whip Driver, however, is equal to New Prohm driver. And right now Ah, you can see that this line sure in this line here are red because we need to import something we need to import here. Selenium. So you can do this by ah clicking here on this lamp here and after that, using open Keidel Tellinem, Or you can just over on the red line here and click control and dot So hold control and dot and the after that you can just click your or press enter toe, select the 1st 1 and is going toe import this using selenium and the same with the chrome driver control and dot and we're importing the selenium not from so I'm going to do this again, But using the other metal show you so click the lamp here and click on the open. Create that Cellini in that room. And it's important this two lines off court for us so we can use the chrome driver Now. Now, the next thing that we want to do is to go to a certain page. So we're going to say go to Google Page. So in order to navigate toe a certain page we need to do this driver doth navigate dot groups that I get like that. Go to your l and we're putting the euro here. So we want to goto https gold dot com like that. So the next thing that we want after we're on the Google page is to write something on the the top that you can search in order to do that. First, let me show you what I mean. I mean to go right now, and, uh, what we want to do is you want to write something here in this search box in the In order to do that, we need to inspect so right, click on the on the browser and click Inspect. After that click on this arrow right here, which is for selecting element. So quickly right here. And after that click on this box that you want to find, Uh uh, Now we can see the it here in the dome, and, uh, we can basically find this element in our coat by different by different attributes. We can find it by name, for example, we can see that the name here is Q. It has class. So we confined by class. Usually you of your search for elements by i, d or expert. But in this case, we can use the name, for example. So the name is cute and we're going toe visuals to you and fight the elements. And we're going to say I whip elements. Search books is equal to driver dog find elements by name. And the name he's que Okay, we found the element which we're looking for this search bar right here where we can type. And now the next thing that we want to is to type something in this bar. So after we find it, we should type something in the search bar, okay. And how we're going to do this by search books dot synth keys, and you can tell by the name what we're going to do with the same keys were going to send something. We're going to type something in this element, so we're going to type. This is the best malformation course ever, ever. And we saved this now. And if we run this way, we should go to Google and type this into the search box. Let's see what happens now. In the next video, I'm going to show you how we were going to run our tests using an unit. But in the moment, we don't have it. So we're going to run this test just by clicking here on the start button. So buried me. We click start and to concede it automatically, it opens the browser. For me and types. This is the best automation course ever into the search books, and it's doing it very fast. And it didn't close the browser because we for forgot to do this. But we can see close the browser and we say driver dot Quit. Okay. And if if we run the program again, it opens the browser, it is going toe type. This is the best automation course ever. And after that is going toe close the brother by driver dot quit. So that's it, guys, this is This is really simple test. But just to show you how the automation works and we can really play with this stuff, for example, we can, As you can see, the browser is opening, not on the full screen. We can change that by ah typing. Cure the browser. Full scream, for example. Driver dotes manage, not window dot mocks mice. If we call this metal and we run the program now, after it opens the browser, it's going to make the browser in full screen. Okay, that happened really fast, but I guess you saw it first. It opened the browser after that, made it full screen. After that, it typed in the search box. This is the best thing. This is the best automation course ever, and it close to the browser again. This is really simple test, but it's just toe. Make your first steps into automation. I'm going to see you in the next lesson. 9. Use NUnit for Your Testing Automation Framework: Hello and welcome to this video today. I'm going to show you what is in unit and why do we need it in our tasting framework? So a unit is basically a testing framework. It is a framework for unit testing and for automation tasting. And we're going to use it in orderto have a structured framework where, how in which we can run the dates and to have a stack trace which they are passing guage tests are failing, and it's really cool, you see, in a second. So what we need to do right now is click on tools, extensions and updates, and we need to find in unity ist adopter. So we're not going to click here on installed, So we're going to click online and in the search box. We're going to type in unit, okay? And we're going to install this in unit three tests. Adopter it. Maybe four by the time you're watching this. But right now, this is the latest version for me, so I'm going to download this, Okay? It says that I need to restart my visuals to do. I'm going to do that. But first, let me also put a reference into our project. The next thing that we need that we need to do is click right click on our solution, managed to get packages. So I'm going to search for an unique and I'm going to install and units. Okay, click the project Install. After that, I'm going to install this in unit three tests adopter again. It may be that the doctor 234 by the time you're watching, this just is told in unit test adapter. Okay. And also the in unit consoled Runner install in your project. And now I'm going to restart my visual studio. OK, guys, Now, after we have installed in unit, then you concede here in the reference we have in unit framework. So what we want to do right now is to separate this coat in tow, three different methods because right now everything is in the main mated and we want to separate this a little bit. We're going to have one method which is only going toe open this page, second metal, which is going to execute our program and the third method which is going to close the program. So we're going out of the main metal, and we're writing our first method. So public void. This method is going to be called initialized and, uh, is going toe open the page for us. The next one is going to be called Execute this, and the 3rd 1 is going to be cold, close program or close tastes. Okay. And ah, in in the initialized metal. We want to put this gold to Google Page. So the first thing that you want to do is to create ah, this ah, Ira driver to make it a global variable. So I'm going to put it out of the main method. Okay? Now, in the initialize meant that I want to put this goto Google page. So where I'm cutting this and putting it here, Okay, in the executes on the test. Ali, just call this execute test. I'm going to put these steps which are basically artists, and in the close, the browser. I'm going to close test. I'm going to put this step which is going to close the browser, clean this white space here. Okay. And now we have this global variable, which is the driver. After that, we have the initialized metals which have the court for going toe the google dot com page. After that, we have this execute test method, which is all the steps toe toe, make the driver being make the browser bigger than full screen after it finds the element and sent some it type something into the element. After that, we have this metal close test which is going to close a close the browser. So what we want to do right now is to click on the test after that windows and after that, this explorer and is going toe open this text taste explorer right shirt, which is going toe to show us all the tests that were running in our program. I'm going toe zoom out a little bit so we can see a little bit more off the court. I hope that's OK for you and right now, how this tastes. Explorer is going to know what it has to run. Basically, it's empty because we don't have any tests right now we have this right here, which is good for start, But how these tests Explorer is going to know what should it run should it run this? Think first went up after that this method And after that, this metal, basically, it doesn't know from where to start and what it should do. In order to do this, we're going to use the n units that we have just installed. And we're going to add on a tribute before each test that we want toe execute. And before this execute tests method, we're going to add attributes, which is called tests. And, uh, right now you freak over over the test and click control and dot you'll see that we need toe at this reference using end unit dot framework, basically just the same thing that we did with the selenium. And with all the other frameworks that we want to use in the project, we need to add the using. So we're we just added the end unit, okay? And now you see that we have something here. We have the selenium automation, which is the our project Selena Automation program. Okay, executive taste. This is our method right here. And, uh, if we run this test right now, this is how you run your tests. This is using a unit to run your test. We're using J unit in Java bit, which is basically the same thing here we're using in unit with C sharp. Okay. And, uh, if I right click on the test and click around selected dates, this test is going to fail. I'm going to explain you why in a second, and this taste felt because we don't have a tribute here in the initialized metal, and the program basically starts from here, which is basically starting from the middle of the program. We cannot there in this coat before we have, uh, because before we get to the page, actually, so there two more attributes that we're using when we're testing. When you're doing automation tasting, we use this attributes called Set Up, and we also use gear down. Okay, so I'm going to explain that what is set up and what is tear down. So the set up is used only in the beginning off your testing framework. So it's used once, and it's executed firstly by your program. So when our program sees this set up is going to come here, execute whatever it is right here after that is going to go to the test is going to execute while they were there is in the test and it's going toe. Finally execute the tear down. So the set up is only the beginning when your start, your program, the tear down is only in the end, when you when you finish your program and in the middle there is this test. Actually, Butte, we can have one set up multiple tests, attributes if we kept multiple tits and after that, one year down to close the program. If we run the taste right now, first is going to look for the set up attribute going toe to find the driver is going toe goto the page. Now it's looking for the taste metal. It's executing everything in the best method, and after that it's looking for the tear down and it's closing the browser. This is how it's properly working and the tests is passing. So this is how you're creating testing automation framework, and this is how you run your tests using and unit. I hope that was useful. I will see you in the next lesson 10. Assert in Selenium Get Page Title and Assert the Result: Hello, guys. And welcome to this video. They I'm going to teach you how to use, assert in selenium and assert. Basically, what it means is that in the end of each test, you want to kill some some kind of verification. You have actual result and expected result, and you want to verify that the actual result is the same, like the expected result, Or, in the other words, you want very fight that this test is correct in its passing. So what we're going to assert now or very fight is the page title off the Google page. So the page title is, uh, this name right here on the top left corner where it is Google. This is the page title. So what we're going to do in our test, we're going to create two variables. Actual results and expected results and the are expected result will be this page title. And we're going to get the title from the browser, and we're going to verify that the expect result is the same, like the actual result. Now, this may sound a little bit confusing right now, but you will see in a second what I mean So let's start coding First, we're going to create two variables source drink actual results and drink expected results . And the expected result will be equal to Google. Okay, because again, our page title is Google. That's why I want our expected results to be Gould. Okay, we have created the two variables, and what we want to do now is in our test. You want to get this page title from the browser and how we're going to do this? We're going to say that, uh, the actual results is equal to driver dot typo. Okay, so right now this driver dot title is getting the title from the browser in the title we're looking for is Google. So this Google title is going to be so the actual result will be equal to Google right now . The actual result and the expected result should be the same because they're both Google. Okay, so let me write a comment here, get the page tyto, and next thing that we want to do is tow assert. So they're a couple of different ways we can use the cert. I'm going to show you right now how I like to do it so we can use this key worth assert dot And after the dot you see all the metals that you can use inside of these assert class so we can use contains. Which means that the variable that we're gonna be using should contain something equals fail falls. We can assert that Ah, it's aside from east, empty is false is true. You can see that there a lot, a lot off metal that we can choose from we're going to use are equal because we're looking for two variables which should be equal. So we're saying certain are equal and the here, we need to pass the two variables that we're going to assert. So we're saying actual results and expected results. So what we did let me explain one more time. First, we created two variables actual results and expected results. We said, Ah, that expected result is Gul. After that, in our test method, we get the page title and said that the actual result is going to be equal to the page title which is Google. And after that we're asserting that the actual result is equal toe expected result. So right now, if we run the test. It should pass because the expected result is Google and the actual result is also go. So it comes to the brother. Now it's going to maximize to make it full screen cap happened really fast and after that it asserts that the actual result is equal is equal to the expected result and what I want to teach you. And I think it's very important every time when you create a taste and you want to verify that this test is correct and it's working fine, you don't want toe. Just see that the test is passing. You also want to see that the taste will fail when the data is not correct. For example, if I change the expected result here, Togo go onto three and I run the test again. I want to see that the test will fail if now the test is passing. This is not good that that means that the taste is not working as expected. But the test right now is failing, which is great and you can see in the stock trades right here. That expected string Clint. It's six but was actually nine. It's expecting six characters in the string, but they're nine and this is the important think right here. It says. What is the expected result and what is the actual results? So expect it is Google, but waas Google onto three. That means that your tests is failing correctly, if that makes sense to you. And if I change this to Google one more time and run the test now, the taste should best because this is the correct data. And every time when you're creating a test to make sure that your taste is failing correctly with the incorrect data and after that, make sure that the test is passing with the correct date. I'm not just passing with the correct data because it happened to me so many, so much times to so many times to see this that somebody is creating in their passing and they're just forgetting about the states. But actually the testes passing with all kinds of data. So it's not a correct you need to see that it's also failing correctly. Okay, that is one way to assert your taste there. There is one more way that we can use, which is assert that after that we're seeing serve that equals and we're saying actual results expected result. This will also work. Let me just come in this for a second. This assert will also work. But these assert death is giving us a bull. Um, which means that it's going to return true off or false. And if we're on the test and the taste is pacing, you'll know you'll not see the difference. Because the testes pacing canned, everything is working fine, just like now. But if we have ah, wrong data and the test is failing, its not going toe tell you why exactly this test is failing is going toe return. That expected result was false. You can see what Here you can see it sure expect the true, but the actual result was false, actually. And it's not telling you what exactly is the problem, and you don't really know how to fix it. You need toe start debugging canto di freely into that the test, and you can spend a lot of time toe understand? Where exactly is the problem and fix it? But, uh, if you're using this assert like I showed you in a second, it's goingto tell you exactly where the problem is going to return, a strength which is not the expected stream that we're looking for. And it's going to say you exactly where the problem is. Just like this one expected Google, but was Google onto three. So I suggest using this one. Let me show you again that this test is working. If we place the correct information and thrown the test again, okay? The tasty spacing and the everything is working is expected. So this is how we're going to use asserts in our tests. I hope this tutorial was useful. Now let's continue with the next one. 11. Element Selectors ID, ClassName, XPath: Hello, guys. In this tutorial, we're going to create a simple automation program which is logging into Amazon and let me show you what I mean. We're going to create a program which is going toe amazon dot com is going to click here, so it's going to simulate user actions after that is going to type some fake email here. Ah, for example, after that is going to click. Continue. Okay, that email exists so they're good type, something different, like this. Click continue. And after that we're going to assert that this there was a problem. Attack appears on the page, and we're going to create a simple program which is going to do this and going step by step , I'm going to explain how you can find the elements on the page. Ah, we're going to use class name or I D and step by step. You're going to understand how to locate elements how to use them called create variables for them and how to click on the elements and help to assert Indian. So let's continue right now. Let's go toe Amazon again. Amazon dot co. Okay, this is our starting point. Let's go to the courts and I'm going toe delete what we don't need from here. Case I'm going to delete this. We still want the brother to be on full screen, so I will leave this year. Heckscher result in the expected results. We don't, uh, needs for now. Okay, like this on the page that we're going to is no longer going to be Googled That comes. I'm going to change this to amazon dot com. Okay, with you have the driver initialized here. After that, we're going to amazon dot com. And after that, we can start making the steps that we want to execute in our tests. So let me create one comment here with the whip. Elements were going to have them all here. So, uh, let's go to Amazon right now and see what we want to do. The first thing that we want to do is to click here on this sign in Bhutan right here. It's not actually a bottle. Let's see what it is by inspecting. So right click. Inspect again. Let me show you right. Click on the element and inspect after that, click on this arrow right here and click on the element that you want to Ah, to inspect and to see the the I. D or the class name or the name off that element. But if you can see, there is a span here with line one and span with lying to. So I don't want any of these because the our program can be confused by these. And what I want toe find is this. Think above them. So if you can see there is a spot right here. Ah, span. Right here. Span right here. So line 1234 And above them is the whole a a crif a a drift back. So what I want to locate here is the whole tack. So ah, if if you want toe locate this element first thing that we're looking for some I d i d is the best way to to locate the element. You can also use an expat class name if it is, for example, this panel right here. Have class This one Have a class also, but we won't locate this attack. And this attack has, um, I d you can see right here i d is equal toe enough link account list and we're going to take this. I d Okay, And we're going to create a new element into our coat with this I d so, uh, whip elements and you're going to say I went Oops. No driver. I whip elements. Sign in is equal to driver dot Find elements by i d. And the idea is equal to this right here. Okay, So, driver for find element by i d. And we're passing the i d here. Que After that, uh, we can Kif here Variations, for example. And we're going to say, son, in both click, you can tell by the name what this is going to do is going to click on the element. Let's see if this is working. So right, Click. You can right click here in the project, or you can right click here on the test and run selected dates or run tastes from here. It's basically the same thing. Now it should open amazon dot com. Okay, so far, so good. Making the browser full screen. And it happened really fast, But you can see that it clicked on the on what we wanted, so ah, if you want to see its lower. We can debug this. So we putting break break point right here, right click and the book tests. So that way we can see slowly what it's happening. Step by step. Okay, it's going. It's going on. The page now is going to stop the break point. So if we click here on the step over, or if 10 it's going to the next tip and we can see that it have clicked on the bottom it now it's waiting for the next step that we want to do here. Okay, let's stop the debugging and remove the break point. So what we want to do right now after we click here, it's we want write something in this email field. So first thing that you want to do is to locate this element. So right click, Inspect. Click on the arrow, click on the element and the let's see what we have here. Okay, we have ah input type, which is email, and it is an I D, which is perfect. As I said, we want to use I D in the perfect send scenario if it has 90. If if you're working in a real project and the element doesn't have 90. You can always talk to the developer to the front end developer and say, Hey, can you please put an I d to this element is going to be really useful for me so I can locate it went up in most of the cases. You'll have no problems at all. Okay, so let's take this element I d which is up email, okay? And we're going to create on element here, so I whip element. Ah, What was that? Email field? OK, E mail. Filthy secret with driver dot find elements by i d and the I d will be What we cope it up. Email. Okay, So the after we have located the element the next thing that we want to do this too toe type something into this email field. So Ah, let's say email field dot ST Keys and what we want toe hopes What we want to put right here is some fake email. So people, people don't a BV dot BG, for example. Ah, okay. And the after that, we want to click continue. So the next step will be to locate this s o. We have typed here people pew at MTV dot BG And we want to click. Continue right now. So right click Inspect to locate this element and you'll see that this it has, um I d continue, which is great for us. We're going to create on Element again. I whipped elements. Continue. Bottom is equal to driver dot Find element by i d and the i d will be Continue. Okay. So what we want to do with this element to you want to click on this element? So continue bottom north, click. Okay, so our program should come here type pupil at abc dot BG and click Continue. Let's see if it were If it's working so far, so run tests is going to happen really fast. Should open Amazon right now. Make the brother full screen. Click on the sign in. Okay, Let's see what happens. So I'm going to put some break points here and the book. This is what happens all the time when you work. When you're writing code. So don't be afraid to d book your program to see what is wrong. You're seeing it right now. Life. Hell, I would see what is wrong. So what is wrong right here. Ihsaa cannot find this element. No such element Exception email field. OK, we're seeing driver. Don't find element by i d ep e mail. Okay, let's see what wrong and why it cannot find this element if we click here, Let's see what is wrong with this element. Okay, I have found where the problem is. The problem is that the program is reading long, but line by line. And what I did was really stupid, actually, because it comes here, reads for this line after that, reads for this line. But it cannot find this element because it first it has to click here and after that should find the email. Ah, because right now it's here, and it's looking for these email Tuck and it's not here yet because for first it has to click your And after that look for this email. So what we're going to do, we're going to remove these comments right here, and we're going to do this step by step. So first, find the sign in bottom after that signed in, click Okay. After that, I find the element field and after that same keys to that element field. Okay, and after that to find the continue button and click on the continue button so it should be like this. Find the signing bottom click on the signing, but, um, find the element filled by I d. After that same keys to the element field. After that finding, click continue button and click on it. So let's try like this, and this happens really often. Guys, just start working and you'll see you'll encounter encounter problems seem programming that's that happens all the time, and you just solved the problems that is basically coding. So don't be afraid toe fail toe de book your program and to learn from everything that you're doing. So now it's working. Fine. Eso it. It goes to the to this page, writes the Pew Pew and clicks continue. So what we want to do right now is to locate this element right here that says there is a problem. We can see that there's a age four with class name. We're goingto make this element a za variable in our program, and we're going to assert that Ah, it has the sticks. There was a problem. So basically, we're going to assert that this email is not correct. And we were not able to log in to Amazon. So how we're going to do this? Let's create an element with this class name. I whipped elements. Their message is equal to driver dot find elements by class name. It's really common to use class name as well. Okay, we found the element. After that, we want toe take the text from this element. So error message fixed. Okay. And, uh, we're going to create a variable. So there, message fixed is equal to Okay, We're going to create a string variable error message text which is going toe going toe. Take the text from this element. The text is, as you can see, there was a problem. What we want to do right now is to create another variable. Okay, this will be actual error message. Text in this would be expected error may. Siege fixed is equal to there was a problem. Okay. And now we're going toe Assert that both of them are equal. So assert equal actual message texts and expected error. Message, Text. Uh, if we run this test right now, let's see what happens now. It should make the browser full screen. Click on the sign in. Okay, this happened really, really fast. So Ah, let's put the brink point here and the book to see what is happening. Step by step. The break point is where you're pro. Your program will stop, and you need to step over the step to see what happens. So the steps before the break point point will be executed right now. Okay. So if I click here, step over or if 10. And go to the browser again. Okay. I can see the time on the page right now. So it happened really fast. Now it here it have typed pew pew at a BV that BG, which is incorrect email and it's clicking. Continue. And the, uh if we over here over our variables actual Aramis, it's You can see what is the the value off this variable? So it's there was a pro. There was a problem you can see right here. And the expected air message is there was a problem. So they're both the same that if we step over again, this test should pass. Okay, driver quit. And the test is passing. Just like we're expecting. So that was our little program. Uh, let me explain one more time what we did. So first we have the driver reference from before. We didn't change that. We changed the page. We're going to So goto Amazon Page should be the comment here. Um, we're going to the euro. We just put the change The Ural here to amazon dot com. Ah, the driver is still going to full screen with even changed that on the we created a Web element signing. So we find the element by i d. Right here. And after that, we say the name of the elements don't click. Click this specific element. After that, we're finding the email field soul. Let me do it step by step. So first we find the element here. The signing element Is this right here? After that, we click on the sign in Element. So click here. After that, we find the email field by I d. So this one right here? Ah, we sent Keyes pupil at a BV. That BG So we're sending this drink into the into here, so we're typing gaby fuel fuel at abc dot BG. The next step is toe. Locate this element. Continue button by I d solve these boots on right here. After that, we click the bottom so we click the bottom. And after that, we ah, created on element for this error message right here. And we find it by class named this time because he doesn't have an i. D you have a class name we created after that two variables. Make sure Aramis just text and we're getting the text from this weapon elements that we have created. As you can see this element have a text. There was a problem. We're getting this text from here from this line of court and we're giving it to this variable actual error message text. After that, create another variable expected error message to extent we make this drink, there was a problem. And after that, we just assert assert that are equal. So what we put inside of these metals Ah, it's going toe check if both of these variables are equal. So we're saying assert that actual error message text is equal toe expected error message text and after we run the test, it's all passing because this there was a problem text is the same, like this takes right here. That's what we wanted to do in our tests. And that's why the taste is passing. So that was really simple program that we're automating the Logan into the Amazon, actually know the logging. But we're automating a problem which verifies that we're not able to log in with incorrect email address. So, uh, that's how we locate elements by i d buy class name you're going to be using Sometimes expert up. You can go toe element, right click and ah, copy. And after that copy expert And if you paste it here, you will see that this is the expert of the element into you can find elements by experts as well. So driver dot find element by and you'll say here, expert, you're going too fast. This expat right here, just like we did with the I d. And, uh, with the with the class name. So, uh, sometimes you're going to be using experts. Sometimes you're going abusing class name. Sometimes I d um, what I suggest is if you have an I d. Always use an idea. It's, ah, the most unique way. And sometimes if you're using a name or a class name. The your program can be confused if they're a couple off elements with this name. But the the idea is really unique for the specific elements. Or try to use I d when you can. I hope this story was useful. Now let's continue with the next one. 12. Facebook Automation Program: Hello, guys. And welcome to these video. In this video, you're going to learn how to create an automation program which is going to create user in Facebook. So let me show you what I mean. We were going to rot, writes a program which is automatically going toe. Come to this. Eurail facebook dot com. It's goto. Feel these fields right here. First name, last name, email, address, email address Again. Password is going to select birthday, uh, month date in a year after that is going toe klik, male or female, and it's going to creak. Sign up. And in the end of this video, you're going to know exactly how to do this, how to read the court and how toe to create this automatic program. So without wasting any more time, let's start with the lesson. So let me right. Click your and inspect on this page. I'm going to click here on this arrow after that, and I'm going to select this first field. So, um, you fellow closer, I will see that this field heaven i d which is perfect for us and what we want to do now in in our Kotis, we want to create an element for these i d This is the first name field, so I'm going to say all right with elements First name is equal to driver dot Find elements by I deep because you're going to find this element by idea. And I'm going to say that the idea is this right here. You, uh, underscore zero underscore m. That's pretty weird. I d but ah, that's what they put in the HTML. So we're going to use that. So after I have found this element first name, what they want to do is I want to type something here. So first name is going to be, for example, John. Okay, so I'm going toe. Uh, say here. First name ST Keys, and I won't type John. Okay, so the first step is ready. We have found this element, and we have to typed John into the element. The second step is to find the last name input field. So it also have an I d. Which is great. Also a weird looking I d. But we can work with that. So, uh, I'm going to say I wept. Element last name is equal to driver dot find elements by I deep. And the idea is going to be this weird idea. Okay. The idea issue zero and all. Yes, this is the one. And after that, we're saying, last name the same keys. What? We want to type here. We want to type week, John week, Because why not? Okay, so we're going to see and keys John week. OK, we kissed the last name. Okay, The next tip he's toe find the e mail. Ah, input field. So, uh, again, we're going to find it by i d. And this is the i. D. You underscore Zero on their score air our soul. We will say I whip element. This will be email. So I'm going to say e mail is equal to driver. Find elements by i d. And the idea is this one anti the male. Want type Jurong week at gmail dot com. Okay. And tough. You can see that. After I wrote this email into this field, this second email field popped up, so we'll have toe re enter our email address. So the thing is still the first email field. So, uh, what I want to say here is e mail dot Sent Keyes. Let me copy this email. I want to send this email in tow. This filth. Okay, the next thing that we have to do is tow. Find the second email field again. We're going to do these by i d So we're going to see here. I whipped element re enter email is equal to driver. Don't find elements by i d and the i d Is this right here? And I want toe re enter email synth keys and I'm going to sense the same email like the previous one, because we want to reenter the same email address. Right. Okay. We have reentered the email address here and now we want to type a password into the password field. So what we have to do first is to locate this element and the these elements also here on the I D. Which is great. We're going toe. Find this element by saying I wipe element password is equal to driver. Dotes find element by i d. This is the idea we're looking for and into these fields. I want type. For example, Mari Awesome blast works. Okay, let me put this year my boss Worth. Okay, now, the next thing that we have to do is we have to click here on this drop down, and we have to select a value from this drop down. Now, here it gets a little bit more interesting, because this is more difficult to do, because first, we have to select this growth down. And after that that we have to select one of these months, for example, I want to select the December. I have to click your first, and I have to click the last value from this drop down list. So how we're going to do this? First of all, I want you to do something. I want you to right click here on your solution. So right, click and click. Manage no get packages. And I want you to ah, search for selenium. And I want you to install this second thing right here. Selenium dot Support. Just click on your project and click install. I hear it is told right now, so I don't have the option to install because I have it already. And after that, what I want you to do is to import this open Kate selenium. Um open. Curious selenium don't support Doc. You I so type on the top of the page using open k dot selenium, not support dot You I just type this on the top of your page. Okay, So the next thing that I'm going to do, I want to locate this element right here. The the month element. So Ah, I'm clicking here on the arrow. I'm clicking on this element and I can see that this element even I d which is perfect for us. The idea this month. So I'm going to visuals to you, and I'm going to create on element I whip Elements Month is equal toe driver dot front element by i d in the i d. This month. Okay. So far, so good. In order to select on element inside inside off a drop down, we're going to use something called Select Element and just bear with me for now. I'm going to say var select element month is equal to new select element. And I'm going to say month here. And if you don't have this selenium dot support, don't you I using on the top, you'll see that the select element will be with a red underline. So in order to use it the select element, we have to import the selenium support. So first of all, install the selenium support, like I showed you from the new get baggage. And after that, we have toe import this framework. So using open curious selenium don't support on the top of the class. And after that, we can use these select element and what we're going to do by this, you can say from the name, we're going to select a new element from this list. So I have created a variable month. Ah, I have created actually this Web element month which were fighting by I D. And we're five finding this element. So, um, after we click here, we need to select a value from this list. And if we scroll down so we see that we have a select here and, uh, beneath these select, we have multiple options. So we have very zero for months, which we don't need, we hear. And from one, they're starting toe count the actual months. So value number one is equal to January. Very to is February very 3 March very four is April and so on and so forth. And the we're going to say right now I want you to select uh, element from this drop down list. Which element value is equal to four, for example. And it's going to select April because very for is April. As you can see right here, let me show you what how it looks from the court perspective. So we have the element here the month element. After that, we're saying var Select Elements Month is equal to new select element and we're passing them on here. We're creating an object. And after that we want to say select elements month dots select by value Because, like I showed you this elements here values we're going to say select by value and the for example, if I want to select the first element, I'm going to save 81. This will be January. Ah, If I want toe select the December, for example, I want to say 12th. So this is going toe select December. Okay, very 1 to 12 and 12. Sequel to December. So right now is going toe. Come here and it's going to click on birthday is going to click on December because this is the value of 12. Okay, the next thing that we want to do is toe do the same with the day. Okay? We did on this thing with a month now, we want toe click on day and to want to select a day from here. So, uh, first we want to find the the main element, the day element. And as we can see if you haven't, I d which is day. So this is perfect for us. We're coming here. Let me copy this month elements I'm going to paste here, and I'm going to say that this is a day i d is equal toe day. The select element is going to be called select element. They and I'm going to pass here. They okay, And here I'm seeing select, uh, select element. They don't select Velo, which they I want to select seven, for example. Okay, seventh off December. After that, we won't do the same with the the ear, so I'm going to click here on the year. The I d is year perfect for us. I'm going to copy this, going to paste it one more time. This is going to be year. The I d is going to be year here. We want to say select elements you're is equal to new select element And we're passing deer here and here. I want to say select element year dot Select by velo 1 1990 No, let's say 2000 and five, for example. Okay, it's going to click here Is going to select 2000 and five. Okay, uh, the next thing that we want to do, if you want to click female male or our custom let's see for example, this male bottom it here's an I d Perfect. So we're going to say I whip element. Oops. I with a man. Uh, what is thes gender bottom is equal to driver. Don't find elements by idea. And the idea is this thing right here. And I want to gender bottom dot Not clear click. I want to click this bad boy. Okay, after that, the last tip, actually, almost the last step is to click the sign up litem. Okay. It also have on i d. So I'm going to say I whipped elements. This is signed. Bottom is equal toe driver. The find element by I D. Yeah, he is this and I want toe Click this button source. Sign up bottom dot Click. Okay, we have all the steps in order to clear to create a user right now. Okay, So after we did all of these, the next thing that's going to happen after we click sign up. Okay. Two main users have this email listed are spending actually the same ill email is not going to work. So let me put something like this, Okay. Excuse me for this. That's what happens when you try. First time. There's always something that you need to change very rare that things happen from the first time and your tests are passing from the first time. So let me try with this email and ah, I'm clicking. Inspect in. If I click sign up, it may change the date here. If I click sign up now. And because this is a fake user and fake email, we're going to see this error message. Sorry, we're not able to process your registration. And this will be our assert. We want Verify that we see this message because your test is not actually a test if it's not tasting anything and if we don't have a assert in the end. Actually, this taste is not doing anything, so it's useless. And yet we want to assert something. For example, if we're creating a really user user, we want to verify that in the end of the test, that is going to say your account was created successfully, for example. But in our case, we're creating a fake user, and we're going to verify that we're not ableto make this rig registration. So we're going to assert that we see this there a message on the screen. Sorry, we're not able to process your registration. And if we inspect this element, we are going to see that it's a There is a thief inside off another dif inside of a form and these different class name and the text is sort of your no table toe process your registration. Okay, so well, we need to find this element first, and we're going to use some experts in this case, and, uh, you can write your own expat. Probably. I'm going to create another video about this, but right now, just for the for the pope purpose off making these videos as clear as possible as possible and not so complicated. We're just going to right click, copy and copy. Expect this is going to copy the expect for this element. Uh, we're going toe Goto visual studio, and we're going to create this element, so I whip element. All right, here. No, our message is equal to driver does find elements by this time we're using as expect. So type expert. I'm going toe paste the expat that I cope it so right click paste. This is the expect that is going toe to find this element right here. This def that have the text. Sorry, we're not able to process your registration, so we cannot ah, used these. Uh, we have to escape this symbol right here. So in front of that, I'm going to put a slash and here I'm going to put slash also. And this will be our ex Speth, and our assert is going to look like this. Assert that error message, that text because we want to take the text from this element that contains. We want to, uh, copy this text from here. Sorry. We're not able to process your registrations. I'm copy this. Coping this text. You can copy it from here, and I'm going toe paste it here. So what we're doing right now, we're asserting that the error message the element that we have found by expert have a text which contains story were not able to process your registration. Basically, where we're asserting that this text is on the screen and the were not able to make registration with this user name. And now the moment off truth. If we run this test right, click your and run tits. Or you can click here on the exact taste. Right? Click and run selected tests. Let's see what happens. It's going to open the brother first. After that, it should goto our euro. Actually, we didn't change the Ural name genius. Okay. Ah, into the initialized method, we need to say go toe facebook dot com. Go to let me cancel this test. Okay. The initialize metal. Now we have got Facebook Page driver that navigate, go to euro facebook dot com And if we run the test right now, it should open the brother making a full screen. After that, go to the euro Facebook dot com. No, actually, first is going to Facebook after that is going to make a full screen and the taste is failing. Okay, Like I said, don't expect your tits to run from the first time. Actually, most of the times you're going to write one line of code you're going to taste. This fits working. After that, you're going to line type to write the second find. Of course, you're going to test if if it's working right. The third wine tasted fourth line tasted and so on and so forth. It's very rare that you were going to type your whole program and you're going to taste it in the end. As you can see, we have written a lot of things and it will be, Ah, miracle if this thing was working from the first time. So let's see, what is the problem was the problem right now, This is also good for you because you can see in real time how I'm doing it. If I see a problem, how I'm going toe to trace the problem and to see how to resolve it. So we have a message here. Okay. Ah, no element. Not interact herbal except exception. Okay, element not intractable. Let's see which is this element? The email field? OK, let's see if we have the correct i d. Let's go to Facebook again. And third. Let's see what's wrong with this email field. Okay, The I d Is you under slash O on their slash Underscore, actually. T Let's see, what we have here are email issue. Oh Air. So this is wrong. That's why you cannot You cannot find the email because the X the the i d that we we gave it. It's wrong. It's check one more time the email fueled Hey, if I d you ot okay, lets go and change this thing right here u o t. Let's see the re enter. Let's see the re enter email field. Okay, let me check that one as well. This is you o w what cave here. Re enter email. I don't know what we have been looking for, but we have all the wrong ideas here. K passwords. Ah, password thes you. Oh, why? Okay. A month month this month. Okay. At least that time is correct. So let me see. First name. He's Ah you. 00 lost name. He's you O que e mail. Okay, your tea. OK, your D on now? They should be fine. Re email. Um, re enter email is Ugh. Ow! Reenter email issue. Old double. Okay, everything looks fine. Now let's run them again. This thing happens all the time. So when whenever something is failing, just don't be afraid to to look into it. Look in the stack. Trace What? ISS Failing What? Why? It's failing and so in and so forth. No, no, it typed a lot of things. Now let's see. What is the problem right now? Okay. Unable to locate elements? Okay. Method sees this little Tokyo U K let's click here. And, um, it's not able to find the gender bottom. Let's see, was the problem here. We want to click on the male bottom, which is an I d off you 07 we have here. You owe seven, and, uh, I have no idea Why is not able to click the element? No such element Kate's trying to find by CSS selector. That's not how we're looking for this element. We want to find this element by I d. Okay. In this case, we're going to the book. Let me put Ah, break point your break point here and I'm going to say I'm going to click Right Click and the book. This is very useful for you because you're seeing real time How I'm handling this situation . Whenever something is failing, you need to know how to troubleshoot how to be book and help to see what's wrong. OK, you can see it was very fast. This is our program right now. So, uh, if you have type in the first name last name, email re enter email password. It has selected the birthday December 7th. Okay. And the it stopped right here. Now it should select the the year 2000 and five. So if I click here on the step over or if 10 and I come here, I will see that 8 2005 was selected. Okay, which is what we were expecting. Great. Now I I wept Element Gender bottom driver Front element by i d. This is No. This should not be No. Let me click. Step over. Okay. No such element exception. This is very strange. Let's see now the the element again. I'm going to click on the arrow, click on the element and inspect the element. The idea is you owe a okay. What we have here gender bottom, find element. But I d you 07 But why? It cannot find the element because the idea is different. Let's try to change this to you. Oh, a Okay, let me remove the break point. Let me close this and start the test again. So you check the element. You check the value of the element. Check the I d. Check the exactly how we're finding it, how you're interacting with the element. And eventually you're going to find the problem. Okay. Now, ah, it's feeling on the next step so it cannot click on the sign in Button Lets the book again . Right? Click D book. At least this time it clicked on the gender bottom. So we have a progress now. He's going to stop before it's clicking on the before speaking on the signing button. So it's inspect right now. Sign up. Actually, I d is equal to you. 0 15 What do we have here? You all 13. So obviously these ideas are changing, which is not good. Facebook should not be using ideas like this. I d should be something which is unique, which is not changing. So probably we should have find these elements by experts. We probably should create our own expert, which is always going to locate this element. And it's not going to change. But usually I D is something that you're using because it's unique. No two elements should should have the same i d. And the idea should not be changing. Um, on Lee unless there is some kind of index changing, for example, element want want 2345 Every time when you're looking, each changing the index often element but not let me not confuse you right now. We're going to put this idea Ah, you owe 15 toe our sign up, Botham, and we're going to run the test again on ideas should not be changing this something that the front end developers off Facebook probably should have them a little bit. Uh huh. Different. Okay, we're going to live like this. The gender button with your a deep and sign a boat on your 15 different noticed again, you'll actually see that the test is so fast that it's going to fail now for the wrong reason. Now, after the clicking the sign up button, I'm going to use a threat sleep, which means that I'm going to say to the website, Oops, Uh, wait two seconds after you click the sign on the bottom because right now is going to clean the sign the bottom. And it's going to try to assert that this text is on the page immediately after that and after we click to sign a button usually takes a couple off, probably cup of milliseconds or not even one second toe toe. Load the page. But just to be sure, we're going to use the sleep on. In order to use this, you you need to import system, not threatening. So, uh, after clicking the sign of bottom, we're goingto say the browser sleep for two seconds. This is 2000 milliseconds, and after that is going to assert because right now it's trying toe. Look for these text immediately, and it is going to feel if it not find it immediately. And now, as you can see the testes passing and that's how you create your automation tastes, so to create a user, a fake user in Facebook and to assert in the end of the test that we're not ableto log in to create actually this fake user. So basically, we're certain that we see this text on the page. I hope that this tutorial was useful. And if you liked the video, please don't Don't forget to leave me a review, because it's really important for me to grow and toe teach more people. So thank you so much for watching how? See you in the next one. 13. Thank You!: congratulations for finishing my whole course. Thank you so much for being my student and for watching all of my videos. Thank you again for being my student. I appreciate you so much. And if you have any feedback and suggestions, please leave me a message. I'm always improving on my courses. I hope that you get the value that you came here for and I hope to see you in my next courses by