Amazon announced support to Selenium Remote Web Driver. Now we have another company that we can use for remote test execution. In this article, I will explain how to execute your test on AWS by changing few lines of code in your automation project.

I think it’s a major news that AWS gets into this business. Most of the cloud testing companies host their services on AWS, Azure kinda cloud systems, and now AWS is in the same business with its full strength. They have the power of S3 to host videos, they have the cloud instance to execute the test and they can give you this service to a very cheap price. Now according to their pricing, if you execute 1.000 minutes of test, you will pay 1.5$. It’s incredible…

Let’s run our first case in AWS.

In this example I will use the sample project and convert it to AWS.

Install AWS CLI

First of all, you need to have AWS CLI installed in your environment. As a pre requisite you need to have python 2.7+ or 3+ in your environment.  Now let’s run below command in terminal.

Then you should execute below command so every user in your computer can access aws cli in the terminal.

Finally, type below code to check if aws cli is working properly or not.

Create AWS Account

You should create an AWS account and setup your AWS Access Key ID and AWS Secret Access Key by following this link. After you create your ID and Secret Key, execute below command.

It will ask you to enter your credentials that you got from previous steps. Just enter those keys.

Finally it will ask you to enter an aws region. Type us-west-2 or any other region. Region may change according to your Amazon account.

Create a Project in AWS

Go to https://console.aws.amazon.com/ and create a Desktop Browser testing project. You can checkout the supported browsers and environments via this link. After you create your project, you will your project arn.


Modify Test Project

All you need to do is to configure the code snippet where you configure your RemoteWebDriver. The sample project that we use, we create the RemoteWebDriver like this.

Now we change it as below

Now, execute your tests…

You will see that test results will appear in device farm console in a minute.

You can access source code via this link.

Happy testing