Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Getting started with AWS Device Farm and Selenium WebDriver

Getting started with AWS Device Farm and Selenium WebDriver

Getting started with AWS Device Farm and Selenium WebDriver by Moataz Nabil

AWS MENA Community

September 26, 2020
Tweet

More Decks by AWS MENA Community

Other Decks in Technology

Transcript

  1. 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
  2. @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?
  3. 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
  4. 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.
  5. COMMUNITY DAY MENA What’s Selenium WebDriver? Selenium automates browsers. That's

    it! Primarily it is for automating web applications for testing purposes.
  6. 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.
  7. 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
  8. 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
  9. 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
  10. 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
  11. COMMUNITY DAY MENA Artifacts The following kinds of artifacts are

    produced: Video recording of your test. Selenium logs produced by the Selenium WebDriver.
  12. 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.
  13. 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.
  14. 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": "*" } ] }