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
 

No comments:

Post a Comment

How to install Java on EC2

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

All Time Popular Post