Take a website link from a user, and take a screenshot of that website on multiple browsers. Return a presigned S3 link to the user
- The entry point of the program is the
run.sh
bash script - The website link is taken as a user input
- The script then verifies that the link is valid by making a
HEAD
request. The program exits with the message to enter a valid link if this request fails - It then checks whether port 4443 and 4444 are available to use or not. If yes, then both the containers (one with chrome and one with firefox are spun up)
- Required
npm
modules are installed. This is to ensure theNodeJS
script to take screenshots runs without a hitch - The script to take screenshots is then run. The script ensures that the urls start with
http://
orhttps://
since theselenium-webdriver
doesn't work with links likegoogle.com
- Once the screenshots have been taken they are uploaded to S3 and a presigned link is created for access. This link is valid for
30 minutes
-
To check if node is installed. If not download from here
node -v
-
To check if docker is installed and running. If not download from here
docker -v
-
To check if aws-cli is installed. If not download from here
aws --version
- Ensure that all the above mentioned tools have been installed
- Clone using the following command
git clone https://github.com/anshuljain03/multi-browser-ss.git
- Add your AWS access keys and S3 bucket in
run.sh
- Run the script using
bash ./multi-browser-ss/run.sh