Saturday, August 13, 2022

Run Selenium tests on Dockerized Grid on EC2 step by step guide - Part 2

 

*******************************************
Run selenium test on Docker grid on EC2 server
*******************************************




To be continue,



- Select ‘Create new Key pair
- Type Key pair name ‘DockerisedASeleniumGrid
- Click on launch instance
- DockerisedASeleniumGrid.pem will be downloaded automatically to login to EC2 instance using SSH


- Success message
- That means EC2 instance successfully created


6. On EC2 dashboard you can see EC2 instance ID. I have provided name it as ‘Ec2_docker’



7. Now let’s login to EC2 instance using SSH
- Open command prompt
- Go to the location(download) where DockerisedSeleniumGrid.pem file is downloaded.
- Use below command
“ssh -i DockerisedSeleniumGrid.pem ec2-user@ec2_public_ip_address”

If you are able to see Amazon Linux 2 AMI, means you are successfully logged in to your server. - shown below


- Update packages using the command “sudo yum update”


We have successfully created and launch the EC2 successfully, Now our next job is to install docker on EC2. 
Check the below link



To go to previous post, click on below link
























Monday, August 1, 2022

Run Selenium tests on Dockerized Grid on EC2 step by step guide - Part 1




*******************************************
Run selenium test on Docker grid on EC2 server
*******************************************

It’s always being a challenging task to run parallel tests in selenium. To setup parallel run on a single machine we need to set up multiple VM’s which consumes so much memory and leads to problems like given below.
  • Makes test slow.
  • Leads to hanging browser sessions.
  • Sometimes browser crash.
To overcome this issue docker came into picture. Which is super easy solution of running selenium tests on a single machine using Docker.


Here Selenium Hub will be running(in docker) on our system and it will delegate tests to respective nodes. But why to maintain the selenium hub on local machine when we have AWS. So to make it more simpler. We are setting everything up on EC2 server itself. lets EC2 manage everything.

Follow the below steps:

1. Login to Amazon console using IAM user credentials

2. Type EC2 in search bar and Select EC2 option.



3. Select Instances option to check if there is any EC2 instance already running.
As you can see below, there is no instance is running.




4. So, let’s create a new EC2 instance. Click on ‘Launch instances




5. Now select Amazon Linux

- Under that Select "Amazon Linux AMI (HVM) of 64 Arch Server" which is marked as Free tier eligible.

Here, An Amazon Machine Image (AMI) is a master image for the creation of virtual servers -- known as EC2 instances -- in the Amazon Web Services (AWS) environment.


- Select Instance Type as T2.micro – free tier eligible
- Click on Launch Instance (Shown below)

Note – Select only free tier eligible otherwise other AMI type is paid which may cost you if you select other than Free tier eligible AMI.




To continue to next post, click on below link
 

How to install Java on EC2

***************************************** How to install Java on EC2 ***************************************** To be continued, In this post...

All Time Popular Post