Part 27 Using AWS EC2 to run selenium tests

Estimated read time: 1:20

    Learn to use AI like a Pro

    Get the latest AI workflows to boost your productivity and business performance, delivered weekly by expert consultants. Enjoy step-by-step guides, weekly Q&A sessions, and full access to our AI workflow archive.

    Canva Logo
    Claude AI Logo
    Google Gemini Logo
    HeyGen Logo
    Hugging Face Logo
    Microsoft Logo
    OpenAI Logo
    Zapier Logo
    Canva Logo
    Claude AI Logo
    Google Gemini Logo
    HeyGen Logo
    Hugging Face Logo
    Microsoft Logo
    OpenAI Logo
    Zapier Logo

    Summary

    In this engaging video, Testing Mini Bytes demonstrates how to use AWS EC2 to run Selenium tests, tackling real-world issues like Docker installation limitations on certain Windows systems. The tutorial walks you through setting up an AWS account, launching an EC2 instance, and running tests on this virtual machine. Viewers learn the benefits of using Linux for cost effectiveness, how to configure security settings, and the importance of terminating instances to avoid unnecessary charges. The guide ends with practical coding tips for running test validations.

      Highlights

      • AWS EC2 provides an easy solution for running tests when local Docker installation isn't possible ๐Ÿ–ฅ๏ธ.
      • Setting up a Linux EC2 instance is budget-friendly and straightforward ๐Ÿ’ป.
      • The video guides through signing up for AWS, launching instances, and terminating them to avoid charges ๐Ÿ’ก.
      • Configuring security settings correctly is crucial for accessing the EC2 instance securely ๐Ÿ”’.
      • Practical demonstration of integrating Selenium with AWS for testing ๐Ÿ“Š.
      • Discussion on avoiding hard-coded values in test scripts and ensuring proper test validation โœ….

      Key Takeaways

      • AWS EC2 is a great alternative when Docker can't be installed on local machines ๐Ÿš€.
      • Creating an AWS account is simple, and the free tier offers cost-effective solutions ๐Ÿ’ธ.
      • Linux is the most affordable option for running virtual machines on AWS ๐Ÿง.
      • You can run Selenium Docker containers directly on EC2 instances for efficient cloud testing โ˜๏ธ.
      • Always remember to terminate your EC2 instances to prevent incurring charges ๐Ÿงพ.
      • Configure your security groups properly to ensure accessibility ๐Ÿ”.

      Overview

      In this part of the series, Testing Mini Bytes dives into using AWS EC2 to run Selenium tests, a handy method particularly useful when encountering Docker installation issues on Windows 7. AWS EC2 allows the renting of virtual machines, providing a flexible solution for software testing. In this session, you will learn to set up an AWS account, choose suitable machine types, and manage security settings efficiently.

        The creator explains the benefits of selecting Linux over other operating systems due to its cost-effectiveness and simplicity. By using Docker pre-installed machines, the video cuts down on setup complexities, making AWS an attractive option for cloud testing. Additionally, the video touches on best practices for managing AWS resources, including the critical step of terminating instances post-use to avoid charges.

          Finally, the video wraps up with practical coding examples, where the creator highlights the importance of assertions in tests, the removal of hard-coded values, and how to properly configure test scripts to enhance reliability and functionality. This comprehensive guide not only helps in understanding AWS EC2 but also improves software testing processes.

            Chapters

            • 00:00 - 00:30: Introduction to AWS EC2 In the chapter titled 'Introduction to AWS EC2,' the discussion kicks off with a brief holiday greeting followed by an acknowledgment of a recent break taken from the ongoing topic of the Selenium framework. The speaker then shifts focus to the intriguing topic of Amazon Web Services (AWS), specifically mentioning that some participants have expressed curiosity about cloud computing. Although details about the cloud or AWS EC2 are not provided in the transcript excerpt, it signals a pivot towards understanding cloud technologies due to audience interest.
            • 00:30 - 01:00: Issues with Docker Installation The chapter discusses common issues people face when installing Docker on Windows 7. It highlights that Docker requires Windows 10 Professional Edition or higher to run. If someone is using a non-professional version, like Windows Home, they need alternatives such as Docker Toolbox. The chapter suggests using AWS as a solution to avoid the complications of incompatible systems.
            • 01:00 - 02:00: Signing Up for AWS Account The chapter introduces the concept of renting resources when you encounter problems with your machine, analogous to borrowing a friend's laptop. It outlines the first step of using AWS (Amazon Web Services) to solve such issues by signing up for an account. The process involves visiting the AWS console through its website and signing up for the services, highlighting the vast amount of resources and capabilities offered by AWS.
            • 02:00 - 03:00: Explanation of EC2 Service The chapter titled 'Explanation of EC2 Service' explains that a company provides machines to users as part of their services. One such service is called EC2, which is akin to renting a computer or machine from the company. Before utilizing this service, users must create a free account with the company.
            • 03:00 - 04:00: Choosing Linux Machine on EC2 The chapter guides users on selecting a Linux machine on Amazon EC2, focusing on the free-tier options to ensure no or minimal charges. It emphasizes careful role selection based on user interest and explains the account creation process, including a temporary hold on credit or debit cards for verification purposes, which is refundable.
            • 04:00 - 05:00: Selecting EC2 Instance Types The chapter discusses the process of signing up and logging into an account to access EC2 instance types. It emphasizes the simplicity of signing up as long as you are a valid customer with a valid card. The speaker goes through the steps, mentioning that they already have an account and showing the sign-in process. The background process of validating user credentials is touched upon briefly.
            • 05:00 - 06:00: Configuring Security and Ports The chapter discusses the alternative approach to running Docker on a personal laptop by utilizing AWS services. It starts by acknowledging that Docker may not be installable on every machine. The solution proposed is to 'rent' the necessary infrastructure from AWS. This method involves using AWS services instead of personal resources to run Docker, making it a practical solution for situations where personal hardware is insufficient. The transcript indicates a step-by-step guide of moving from local Docker installation to AWS deployment, ensuring continuity and efficiency in operations.
            • 06:00 - 07:00: Connecting to EC2 Instance In this chapter, the focus is on connecting to an EC2 instance. The discussion begins with a scenario where the user's local laptop does not have the capability to run Docker, either due to technical limitations or the user's desire to explore AWS services. The solution presented is to rent a virtual machine (laptop) from AWS, specifically using EC2 (Elastic Compute Cloud) services, to perform the necessary tasks that cannot be performed on the local machine.
            • 07:00 - 08:00: Running Docker on EC2 In this chapter, the discussion focuses on the flexibility and cost-effectiveness of running Docker on different operating systems when using Amazon EC2 instances. The emphasis is on choosing the type of machine that best fits your needs, highlighting Linux as the most cost-effective and easy-to-set-up option compared to Mac OS and Windows. Mac OS is noted to be expensive, whereas Linux offers ease of setup and affordability, making it the preferred choice for running Docker on EC2. The chapter thus guides the reader in making informed decisions based on cost and setup simplicity.
            • 08:00 - 09:00: Executing Tests on AWS EC2 The chapter titled 'Executing Tests on AWS EC2' discusses the process of setting up and using AWS' Elastic Compute Cloud (EC2) for executing tests. It suggests using a Linux machine from AWS, highlighting that while setting up Windows might be time-consuming, Linux offers a simpler alternative. The chapter explains that EC2 is one of many services provided by AWS, standing for Elastic Compute Cloud.
            • 09:00 - 10:00: Terminating EC2 Instance The chapter titled 'Terminating EC2 Instance' introduces the concept of storing photos and videos using Amazon's S3 service, likening it to Google Drive. It briefly touches on using other AWS services such as EC2, which allows for launching and managing virtual machines situated globally. The transcript does not detail the EC2 termination process specifically but sets a premise for exploring cloud storage and computing solutions.
            • 10:00 - 11:00: Video Conclusion and Next Steps The chapter discusses the global presence of facilities with a large number of physical bare metal servers, likening them to factories due to their size. It notes specific locations such as the US, India (Mumbai and Bangalore), and Singapore as having these technological resources.

            Part 27 Using AWS EC2 to run selenium tests Transcription

            • 00:00 - 00:30 foreign welcome back I wish you all a very happy new year sorry for bothering you and then you are I thought you know we will take a couple of days break anyways so so we we will cover some really interesting topic today um even though we have started with the selenium framework yesterday um we will take a little break on that uh we will try to cover something related to AWS some some of you have asked me what is cloud and all that and some of the
            • 00:30 - 01:00 people have issues installing a Docker and windows 7. so if there is if you are one of the guys who couldn't install Docker uh maybe due to some other reason because Docker needs a Windows 10 pro professional Edition to run again if you are using non-professional version like home you have to use something else like darker toolbox and all that so you don't have to uh mess with a lot of things like that we have our friend AWS to help us so imagine if you have
            • 01:00 - 01:30 some problems with your machine what you do you go and rent uh you know you go and take your friend's laptop right so that's what we're going to do we have some problems with our machine so what are you going to do we're gonna take a help from our AWS all right so uh let's go to amazon.wms console all right sign up okay so if you go here so these amazing guys what they have done they have a lot of
            • 01:30 - 02:00 okay uh they have a lot of machines with them right and they have provisioned a lot of machines and then they have given people to use it right so they provide a lot of services one among them is he called us easy too which is like renting and printing some laptop or machine from them right so that's what we're gonna do but to do all that you need a account so you need to go and create a free account okay
            • 02:00 - 02:30 so this is a free tire okay so they may not charge you for anything so be very careful so just choose your role whatever you're interested you are and you know all that and then you can click on submit and then you can go ahead and create a new account okay they might ask you for your credit card details or debit card details you can give that they may charge you one dollar or two rupees and then they will return you back okay so they will validate whether
            • 02:30 - 03:00 you know you are a valid customer and your card is valid okay so that is one thing they will do it's a very very simple process to sign uh sign up so please do sign up uh complete the sign up you can click on it and completed but in my case I already have an account with me so I'll go to the sign in page okay maybe it will ask for the username and password since I already have logged in it is showing me a movement here right so I have already been logged in now what we are going to do so the problem
            • 03:00 - 03:30 is we cannot install Docker in our machine so we are going to rent it from our friend AWS so that's a very simple statement right good so let me put uh Pane and then explain so previously we have our laptop here this is our machine laptop and we ran Docker and say that right so we have installed Docker inside this okay now then we have our container support running here right so right we
            • 03:30 - 04:00 are we are doing like this right so but yeah but now what we are going to do our laptop is here right our laptop is now will be here our laptop doesn't have the capabilities to run darker say whatever reasons right or even though you want to explore even though you can do it but you want to still explore AWS and all that so what we are going to do we want to rent a laptop from them so so we're going to create a laptop okay we're gonna this is the AWS machine
            • 04:00 - 04:30 okay we're gonna rent it out and then we can choose we are free to choose what kind of machine we want let's say you can choose what kind of machine you clean X you can choose a Mac OS you can choose a Windows machine whatever you want but the cheapest option is Linux okay Linux is very cheap okay very easy to set up and all that so we will use it so Mac OS it is very expensive if you want to rent Windows is also cheap but uh elix is very easy to set up on
            • 04:30 - 05:00 all that very very simple processes okay in Windows you need to set up the wires and all that very very it might be a little like you know a time than the Linux so we will use Linux okay we are going to uh rent a Linux machine from them so the service is called as ec2 okay the service name uh they are having lot of services okay uh one among them is called as ec2 ec2 means elastic compute Cloud elastic compute cloud
            • 05:00 - 05:30 okay if you want to store your photos videos and all that they have some services like S3 okay similar to Google Drive okay you have Google Drive Right the same way they have some Services called as S3 they are not going to use all that so this is one of the services that they provide okay we're going to use Easy tools now we want to enter Linux machine right but there are a lot of places where they have machines okay let's say uh all over the world okay let's let's put this way okay all over
            • 05:30 - 06:00 the world they have a lot of places okay maybe in us they have a lot of places where they have okay provision a lot of machines okay you can take them okay and then there are India and they have it in Mumbai and Bangalore it seems in Singapore they have they have around the world they have a lot of places where they kept a lot of physical bare metal servers okay imagine they are all very very big okay very big you know it's it's like a factory okay they'll be very big okay in that you know we are going to take a
            • 06:00 - 06:30 provision okay we're gonna visualize them and then we can cake with very small part of it and then we're gonna use it okay in your case whatever the region that is near to you you can use that okay but it doesn't make a big difference whatever you use maybe you can if you are in from India you can use Mumbai or Singapore somewhere near to it what I normally use North Virginia uh you know just make sure that you are remembering what region you are creating okay don't create in multiple regions uh
            • 06:30 - 07:00 because we need to whatever the machine we are renting out we need to return it back right we need to terminate it okay otherwise they might charge you so make sure that you are choosing whatever the region and then you delete the ec2 instance at the end okay that's very important so once you are here just search for ec2 now you get this right so just click on this we're going to enter ec2 machine now so it has loaded but see I I'll go here
            • 07:00 - 07:30 okay otherwise you can there will be option to launch an instance from here but for me it is showing here I'll do this okay launch an instance okay now it is showing you a lot of options okay this is a Linux machine so okay this is an Amazon Linux if you want a Mac OS okay you can use this Mac OS okay but this is all will be costly okay and then
            • 07:30 - 08:00 if you want uh red ad Linux you can use this you see Ubuntu Linux you can use this if you want Microsoft Windows you can use this okay so if you want whatever you want you can use this but all these machines will have something okay let's say this this Linux box this Linux box doesn't have anything okay just it is having some Libs and Bin utils that's it okay you need to install Docker yourself so that is a little time taking so I will search for Docker here now if you notice this has Docker
            • 08:00 - 08:30 already so Docker is already there so this is a brand new machine with the tensorflow installed by python pythars installed some other other you know things are installed but for us we want only the one that is having Docker right either you can choose this you can choose this all these machines are having Docker installer so you don't have to go and install it right so it is already having them okay so let's take this machine that is Amazon deep learning AMA whatever anything this one
            • 08:30 - 09:00 or this one anything this is fine so let's click on this and let's see there are a lot of things available okay so if you notice each of the tires have different different machines let's say this is one CPU one GB memory okay so if you want a bigger machine okay if this is an 8GB RAM and with 32GB memory okay so these are all different sizes but among them only this one is for free tire okay maybe if you are doing a small little bit of practice how to do this you can use this okay but
            • 09:00 - 09:30 this might not be uh really worth it if you want to do entire regression shoot run because this will not have enough CPUs to run your test automation suite at that time you may have to choose for a 4GB Ram okay minimum 4GB Ram this will do okay but don't imagine like they will charge you very very big okay maybe in Indian Rupee if you think like 20 rupees 30 rupees they will charge okay so that's okay right 20 rupees 30 Rupees is not a big deal even a Biryani now
            • 09:30 - 10:00 costs 250 rupees right so in you know if you if you take a uh US dollars they may charge you 20 cents 30 cents some very small amounts right so don't worry about that but for now I am just creating a free tire and then I'll click on next details okay now we choose what kind of machine we want what is the amount of CPU we need and then there are different options here uh I don't want to dig deep in here but maybe at some point of time you can learn about all that but one
            • 10:00 - 10:30 important thing is there is request part instances something here okay spot instances means uh you know uh your your uh you know sparse is a very cheap okay normally the ec2 instance May cost you 50 cents then the spot instances May cost you 10 10 cents it is like somebody have already purchased but they are not using it okay so in the meantime they will give you for free for example uh in our places we'll have wedding halls
            • 10:30 - 11:00 right there will be uh not booked in all the time okay only during the you know occasions they will be booked but another period they may rent it out to birthday parties and all that right the same way this art instances are like that somebody have already purchased them but they are not using it so they will give you till they come okay but these are all not really reliable because once the real owner comes and takes it away you you might have to uh
            • 11:00 - 11:30 you know your work might go away so this is not really uh this is really useful if you want to really quickly try out something with cheaper price okay but for now I'm not checking this at least all the things you know I will I will not speak about subnets what is Network IP and all that it may take a lot of time but just click on add storage okay it is giving you 45 GB of storage that is more than enough for instance SSD type storage that's okay that's all good uh let's declare an ads we don't need ad now uh tags now so we will just
            • 11:30 - 12:00 click on configure tags okay this is very important section where you need to configure what kind of ports you are going to use okay so we are going to rent out some machines here right so if you install Docker and then if you install selenium container okay this container will expose to Ports right one is double four double four one another one is seven nine double zero we already know this this port will be mapped to this machine Port of 4 4 4 4
            • 12:00 - 12:30 okay and then seven nine double zero so only these ports will be exposed to the outside world okay so I need to point my test to this particular port to this machine Port this will be delegated to The Container code okay so you need to expose these ports to the outside world okay from this machine otherwise it cannot be accessed by anyone and then you can also Define who can access this okay only Amazon can access this
            • 12:30 - 13:00 and then prints and then uh kalai can access this you can Define who can access this from which machine they can access this okay so let's go here first let's add one more import and the port is we want to First expose double four double four who can access this so now for now anyone can access this anyone this this means 0.0.0 means anyone across the world can access this because this is just for a demo so we are giving access for everyone otherwise you can restrict with the help of IP address
            • 13:00 - 13:30 okay and then there is also one more Port I want to expose that is 7900 that also everyone can access okay that's it guys so these are all the three things we are going to make a necessary connection into this and then we are also exposing two ports okay so that's just enough so we will click on launch so it is telling hey you are telling uh uh you know your instance is not eligible for free tire maybe uh the amount of CPUs that I use and all that maybe it is not free at all so okay
            • 13:30 - 14:00 that's okay they may charge a little bit that's fine for me um and also they are telling your instance is open for everyone that is okay because I'm gonna close it sooner okay so just click on launch okay now in order to connect to your machine you might enter some password and all that right anybody cannot connect so to maintain all that you might create a new key value pair okay new keeper just tell some name like demo uh Celine something like this okay some name create new
            • 14:00 - 14:30 keeper demo selenium and download The Keeper once you download this it will go to your downloads right and then you can click on launch instance you need this file in order to connect to the machine okay otherwise you cannot connect see now it is telling your instances are now launching so it is now we started to we told them hey this is a requirement we want to uh get a Linux laptop with this Locker
            • 14:30 - 15:00 installed and all that this is our requirement so Amazon is constructing a you know it's building a which you know machine for us to use okay so let's click on reload until the the state of the users becomes active there is Amazon AWS is very simple okay people might tell it is very complicated and all that but all these cloud services are very simple things okay whatever we do in a real-time world we are doing it in the Cloud Pro so if you notice this instance is now up and
            • 15:00 - 15:30 running now you can make connection to this and then you can use it so this is the IEP address of the machine that we created okay this IP address is public so it is accessible to everyone this you can also use the DNS okay you can use either IP address or the DNS to connect to this particular machine okay now what we can do if I need to connect to this machine right I need to uh start the docker container selenium Docker container in this machine so for that you can click on instant state
            • 15:30 - 16:00 okay or the actions so let's wait there is a connect button that will get enabled it will take a little bit of time maybe so you will get the connect symbol okay
            • 16:00 - 16:30 so any doubts in the meantime you can ask him any doubt so far foreign
            • 16:30 - 17:00 yeah if you guys notice when I clicked on this instance now this is the IP address
            • 17:00 - 17:30 now we are getting the correct option okay just click on this connect there are different ways you can connect to this machine and install the selenium Docker container right so you can either do this you can do this but the easiest way is using the SSH client okay so they have given what is the command that you have to use to connect to this machine okay so let's open my windows terminal Let's uh you need to go to the location where your dot pimp file is downloaded so it will be in
            • 17:30 - 18:00 download so I am just opening downloads okay so if I do this demo hyphen selenium is present in my downloads folder okay so after you navigate to that particular portion you have to type this command okay SSH hyphen I so the same command switch F9 okay and then demo hyphen selenium or maybe you can copy it from here
            • 18:00 - 18:30 and then you can paste it okay but just change one thing okay you have to go here and remove this double quotes okay and then instead of root user we need to tell ec2 hyphen user okay so just do this thing okay so we are going to uh do the cell you know SSH which means we are connecting it to it remotely okay guys that's it and then
            • 18:30 - 19:00 using the you know this particular Pim file use this spam file for password validations okay and log in as a root user so this is not a ec2 user so this is an admin user kind of thing and we are going to log into this particular machine this is the DNS address of the machine right here you all know so this is the DNS address that we it gave us ending with two not five right so ending with two not five so that's the command so let's go and click on
            • 19:00 - 19:30 enter so now it is telling hey uh you want to really connect to this particular Mission yes I want to connect to the machine so it is still clearly uh Amazon deep learning Ami GPU so you have now connected for example notice now I am not in my machine I am actually in this machine I have there is a command prompted The Bash shell in this machine right there is a command prompt in this machine I am here okay now I can install Docker you can do all the stuff what I
            • 19:30 - 20:00 want to do let's say I do player I'm sorry so now what you can do I can tell Docker to check whether the docker is installed so I've been saying this particular machine and I'm trying to check whether the docker is there so yes Docker is there so what I can do now I can basically install uh the you know I can pull the selenium uh image and then I can run it so darker run you can pull and run or you can directly
            • 20:00 - 20:30 run so if you if the image is not there it will directly pull it from the docker up Docker run iPhone p double four double four double four double four right and hyphen p seven nine double zero colon seven nine double zero and then we have selenium Standalone Chrome what is the version you want 96.0 that's it guys so now we want to run this
            • 20:30 - 21:00 so if we add hyphen D at the start here which means the it will it will you know it does not go to the listening mode okay previously it will go to the listening mode you need to use a different command prompt you want to type something but in my case I don't want to do that so I put hyphen D which means detached mode okay the logs will not be shown here okay you can use the same command prompt okay so it is downloading all the stuff it's very very simple right so you are
            • 21:00 - 21:30 renting out a machine that has Docker installed so your job is now very easy you just need to run uh just pull this Docker container selenium Standalone Chrome image and then run it that's it you can now execute your test in AWS so you will you all started to learn AWS so in the meantime whether when it is getting downloaded if you have any questions you can ask me now any questions from anyone
            • 21:30 - 22:00 what kind of a user do you use C2 hyphen user let's say if you are logging to your machine what do you do you you enter username as kalai and you will enter some password right yeah the same way the username is easy to user by default okay just use this the password is taken from the Pim file that we given okay okay okay that's very simple don't don't think too much yeah so now this is downloaded okay so if it
            • 22:00 - 22:30 is downloaded let's check whether this is running Docker PS oh yes this is running it has also exposed the port double four double four okay that's fine if I run the test will it work let's go and start to run so I have localhost terms for double four uh can anyone tell if I run this it will work or not I will ask question
            • 22:30 - 23:00 okay it will work or not should work okay let's check this is not working like so it is telling invalid address of the remote server okay whenever we are starting the docker container we can check localhost
            • 23:00 - 23:30 444 let's see what is happening okay this is this is um exactly so let's say previously we installed in the docker in our machine so we mapped the laptop for our our localhost Port 4444 to The Container report four four four four but this time uh what we are going to do we are not running the docker in our machine the docker is running in this
            • 23:30 - 24:00 machine so we need to go give the IP address of this particular machine okay this particular machine so what is this AWS machine IP address say already mentioned this is the IP address so let's copy this put it here colon number four double four so we have this selenium grid up and running on the Amazon ec2 instance right so we will check whether the 7900 is
            • 24:00 - 24:30 also working so let's copy this paste it and seven nine double zero so yeah we have the vmc server as well to to view the execution okay so let's click on connect let's enter the password password is Secret ah we have everything up and running again guys you can use this particular IP address or
            • 24:30 - 25:00 the public AP this one with the DNS okay so instead of this if I also mention okay I can also use the DNS okay whatever you feel comfortable you can use it okay you can use any of these right and maybe you can remove this questions
            • 25:00 - 25:30 okay so you can use either the IP address or the DNS now you can either Point your test to this so let's copy this and let's go here and just change only one thing okay that's your that's it guys so now instead of running our test in my localhost I am running in this particular IP address double four double four let's try to run the test and see where it is happening
            • 25:30 - 26:00 also go and see the live execution here okay if you notice the browser is now getting launched so your test is now running in AWS okay so you can all put in your resume that I know how to run a test in a AWS machine
            • 26:00 - 26:30 right good so if you notice the test is also getting passed everything is working absolutely fine okay any doubts in the sofa Okay so uh I uh you joined very late today but I I haven't started yeah but uh for you
            • 26:30 - 27:00 only I covered this yeah but the recording is down yeah okay okay fine then we will continue with the selenium framework we all now know how to deal with the AWS anyways most importantly please try to terminate the machine okay uh I have used this okay if you go and uh stop it you can again restart it but if you want to terminate you can terminate it so if I do just stop you can again start it back but this time I don't want to start
            • 27:00 - 27:30 it back at the end of the day I want to terminate it okay otherwise they may charge you okay so just make sure that you successfully terminate okay and then it will go to the setting down state and then it will go on to so now it is going to shredding now it'll take couple of minutes and then it will shut off okay and then if you come here and then reload the page there won't be anything here okay so make sure that you are removing everything uh without fail otherwise they may charge you okay so yeah be very
            • 27:30 - 28:00 cautious where in which region you are creating the instance and then at the end of the day try to shut down everything okay there is also way where you can go and set up alerts if if the amount is exceeding 10 Rupees you can message me something like that so that you can come on clear if if there is any uh anything that without your notice you have created something it will send you an alert using the download you can come and clear all your stuff okay so you can set up alerts just Google how to set up alerts in AWS console we can get the
            • 28:00 - 28:30 things okay so once you terminate this this might not be up and running so so now this is not reachable anymore so this machine you have rented a machine from AWS you now gave it back to them okay you are not using it anymore but for me I cannot terminate okay so it will charge like for every month it will charge or like what what should I do there's no charge you so just practice it once and then leave it
            • 28:30 - 29:00 okay you are not going to use Docker every day okay okay so don't just practice that's it okay thank you okay uh now let's go to the selenium framework again and we have created some login tests and all that so we are getting the title and then printing it but uh uh maybe we need to enter username password and we want to enter uh get the title from the home page and then we need to validate it so let's uh go to the resources and then configure
            • 29:00 - 29:30 properties and copy this so yeah thank you so so you want to enter here and then we want to do so we will get this particular page title and then we will assert it each of the tests should have a particular recession okay so it is not recommended to have a test without a session okay
            • 29:30 - 30:00 you your all your tests should have something to assert here we are not doing any validation so this is not a good test case your test case need to have some kind of assertion okay so let's just log in and do the assertion and maybe we will continue with the remaining topics from Tuesday so you all have we can all enjoy your new restaurant good so maybe I'll log out first maybe I'll take the title name now so go to the Head title list or in HRM here as well okay that's fine
            • 30:00 - 30:30 let me do the log out username is basically the final element by Dot okay ideating sorry okay so inspect it and this is right okay
            • 30:30 - 31:00 so again we are doing one mistake we are doing the hard coding here so right that's the reason I want to again explain this text password okay admin one two three and then
            • 31:00 - 31:30 foreign and I want to assert this right so maybe I'll tell lasso dot assert equals okay you need to give the actual actually drive.get title I want to validate this whether this is equal to Orange Etc okay so yeah so this is my test case
            • 31:30 - 32:00 now you can try to run it and then see if this is working foreign so whenever you are creating a test make sure you are having an assertion and then you all you should also test your assertion if your obsession is failing or not okay don't just create for the
            • 32:00 - 32:30 positive test a good tester will always give some invalid values and check for the error message okay so whether this is throwing proper error or not that's very very important thing to do most of the people who are writing code now they are not doing it but you don't do that okay foreign about our code okay so now the test will fail okay and yeah it should fail and you
            • 32:30 - 33:00 should see the proper reason here right that's really good and at the end of the day you want to be even okay uh quit the browser okay driver not quit okay good so now uh you know uh we will move this common thing so this is something that is getting executed before each of these things right so let's cut this let's
            • 33:00 - 33:30 create a before method okay so setup method and here we'll put all these things right and we'll also have before sweet right before sweet which I have already covered about all these things so I'm going little fast so this one is just only once we need to do right so if we want to use owner Library
            • 33:30 - 34:00 we want to create a reference only once right and then we have after method we will also create after method so tear down method we can create and then we'll put this here right now our test is very less lines of code but the problem is these variables are not accessible so what you have to do you have to basically use this something like this
            • 34:00 - 34:30 and then we also have driver right so let's copy this okay all good all good all good yeah this is all good looks good let's try to run the test again and then check everything is working fine
            • 34:30 - 35:00 okay all good so we will change it to HR mode so yeah so everything is basically working absolutely fine so now we have created only one test right suppose you want to create one more test let's say this is your title validation test right so this is uh title validation test okay
            • 35:00 - 35:30 okay whether the title of honors HRM home page website home page is displayed correctly okay whatever correctly okay so you can do this right good so this is fine now
            • 35:30 - 36:00 now we want to create one more test so for one more test sometimes if it is related to the login page itself you can create it here maybe this is not a login test right this is a home page test right so let's go and rename this so let's go here refactor rename this is not a login test we are we are logging in but we are testing the home page title right so we can tell home page tests there is only one test so we are giving test okay if there are multiple
            • 36:00 - 36:30 tests in this class can give tests okay let's see very effective so now our code looks much much neat but tomorrow we will create one more test and then we will see where to put these all these things okay maybe we will create a base test we'll move all those things there okay and most importantly if you notice we are hard coding things here okay this is something that we don't like we need to remove all the sort coding right we'll do that okay so yeah we will stop because it's already 7 42 uh I stop the