Slide 1

Slide 1 text

COMMUNITY DAY MENA Getting Started with AWS Device Farm and Selenium WebDriver

Slide 2

Slide 2 text

COMMUNITY DAY MENA Agenda Why Cloud Browsers/Devices? What’s AWS Device Farm? What’s Selenium WebDriver? What’s Selenium Grid? AWS Device Farm Desktop Pre-requisites and Configuration How Does it work? Supported Browsers, OS and Capabilities Pricing Security, Access Control and IAM Technical Demo

Slide 3

Slide 3 text

@moatazeldebsy @moatazeldebsy Moataz Nabil Senior SDET Berlin, Germany moataznabil.net Business domains: Agriculture, Telecom, Healthcare, Fashion, and Food Delivery. Designed test automation frameworks for Web, Mobile and API using a different set of tools and languages Participated in the implementation of different CI/CD pipeline using different tools: GitLab, Bitbucket, Bitrise, and Jenkins. Delivered online test automation courses Who am I?

Slide 4

Slide 4 text

Testing across an extensive range of desktop browsers and real mobile devices No need to provision and manage any testing infrastructure Run your tests concurrently to speed up the execution of your test suite Generates videos and logs to help you quickly identify issues with your app Why Cloud Browsers/Devices? COMMUNITY DAY MENA

Slide 5

Slide 5 text

COMMUNITY DAY MENA What’s AWS Device Farm? AWS Device Farm is a testing service from AWS that can help us to improve the quality of our web and mobile applications by testing them across a wide range of desktop browsers and real mobile devices without the need to deploy and manage a test infrastructure. The service allows us to run our tests on multiple desktop browsers or real devices to speed up the execution of your test suite and generates videos and logs to help you quickly identify problems with your application.

Slide 6

Slide 6 text

COMMUNITY DAY MENA What’s Selenium WebDriver? Selenium automates browsers. That's it! Primarily it is for automating web applications for testing purposes.

Slide 7

Slide 7 text

COMMUNITY DAY MENA What’s Selenium WebDriver?

Slide 8

Slide 8 text

COMMUNITY DAY MENA Selenium Grid and Remote WebDriver If you want to scale by distributing and running tests on several machines and manage multiple environments from a central point, making it easy to run the tests against a vast combination of browsers/OS, then you want to use Selenium Grid. You can use WebDriver remotely the same way you would use it locally. The primary difference is that a remote WebDriver needs to be configured so that it can run your tests on a separate machine. A remote WebDriver is composed of two pieces: a client and a server. The client is your WebDriver test and the server is simply a Java servlet, which can be hosted in any modern JEE app server.

Slide 9

Slide 9 text

COMMUNITY DAY MENA Selenium Grid and Remote WebDriver

Slide 10

Slide 10 text

COMMUNITY DAY MENA AWS Device Farm Desktop Previously we can use AWS Device Farm for mobile testing only but now we have an option to use it for running our Selenium tests on multiple desktop browsers hosted on AWS. You can run your tests in parallel on multiple browser instances to speed up the execution of your test suite. For every browser, the test is executed on, Device Farm generates video recordings and Selenium logs to help you quickly identify any issues with your web app. The feature is only available in the us-west-2 (Oregon) region

Slide 11

Slide 11 text

COMMUNITY DAY MENA Pre-requisites Install AWS CLI, check AWS Documentation for more details. After installing AWS CLI you need to configure your account with command using aws config Device Farm Project ARN

Slide 12

Slide 12 text

COMMUNITY DAY MENA AWS Configuration You need to add the following credentials: AWS Access Key ID AWS Secret Access Key Default Region Name - for example us-west-2

Slide 13

Slide 13 text

COMMUNITY DAY MENA How Does It Work?

Slide 14

Slide 14 text

COMMUNITY DAY MENA Supported Browsers and Platforms

Slide 15

Slide 15 text

COMMUNITY DAY MENA Supported Capabilities browserName: Name of the browser to use for the session browserVersion: Version of the browser platform: windows by default aws:maxDurationSecs: Maximum duration of the session before it is forcibly closed, in seconds. Range: 180 to 2400 aws:idleTimeoutSecs: Maximum delay between WebDriver commands before the session is forcibly closed. Range: 30 to 900

Slide 16

Slide 16 text

COMMUNITY DAY MENA Artifacts The following kinds of artifacts are produced: Video recording of your test. Selenium logs produced by the Selenium WebDriver.

Slide 17

Slide 17 text

COMMUNITY DAY MENA Pricing Example: If you execute a test run on Chrome v78 (80 min) Chrome v77 (100 min) Firefox v68 (120 min) Then the total test duration will be calculated as 300 minutes. You will be charged $1.50 (300 instance minutes * $0.005 per instance minute) for this test run.

Slide 18

Slide 18 text

COMMUNITY DAY MENA Security Device Farm does not collect the content of your web application except what's required to run the service. Your tests are run in isolated instances. They are not shared by any other user or test. Artifacts (logs, video, and so on) are associated with your account. Files that you download in your tests are not collected. Any content that is saved in the browser (for example, cookies or LocalDB storage) is lost when your session ends.

Slide 19

Slide 19 text

COMMUNITY DAY MENA Access Control and IAM The desktop browser testing feature is integrated with AWS Identity and Access Management (IAM) which you can use to: • Create users and groups in your AWS account. • Easily share your AWS resources between the users in your AWS account. • Assign unique security credentials to each user. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "devicefarm:*", "Resource": "*" } ] }

Slide 20

Slide 20 text

COMMUNITY DAY MENA DEMO

Slide 21

Slide 21 text

COMMUNITY DAY MENA Resources https://docs.aws.amazon.com/devicefarm/latest/testgrid/what-is-testgrid.html https://docs.aws.amazon.com/devicefarm/latest/testgrid/getting-started- migration.html https://docs.aws.amazon.com/devicefarm/latest/testgrid/techref-support.html https://docs.aws.amazon.com/devicefarm/latest/testgrid/testing-frameworks- java.html

Slide 22

Slide 22 text

COMMUNITY DAY MENA Thank You!

Slide 23

Slide 23 text

COMMUNITY DAY MENA Questions!