moving from a selenium grid to the cloud - a real life story

24
Anshul Sharma, Sr. QA Engineer, Emmi Solutions August 10, 2016 Moving From a Selenium Grid to the Cloud – A Real Life Story

Upload: sauce-labs

Post on 09-Feb-2017

455 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Moving From a Selenium Grid to the Cloud - A Real Life Story

A n s h u l S h a r m a , S r . Q A E n g i n e e r , E m m i S o l u t i o n s

August 10, 2016

Moving From a Selenium Gr id to the C loud – A Real L i fe Story

Page 2: Moving From a Selenium Grid to the Cloud - A Real Life Story

05/01/2023 PROPRIETARY & CONFIDENTIAL2

About Emmi Emmi develops patient engagement solutions that help people take active roles in their health and wellbeing.

Page 3: Moving From a Selenium Grid to the Cloud - A Real Life Story

05/01/2023 PROPRIETARY & CONFIDENTIAL3

About MeLead Automation Engineer

Page 4: Moving From a Selenium Grid to the Cloud - A Real Life Story

05/01/2023 PROPRIETARY & CONFIDENTIAL4

Agenda• Introduction:

– Selenium Web driver – Selenium Grid

• Selenium Grid:– Need– Problem

• Benefits of moving to cloud platform from grid• Introduction to cloud platform- Sauce Labs• Best practices and advantages of moving towards cloud platform• Demo• Q & A

Page 5: Moving From a Selenium Grid to the Cloud - A Real Life Story

05/01/2023 PROPRIETARY & CONFIDENTIAL5

What is Selenium Webdriver?

• Selenium is a web API which drives interaction with browser

• Repeatable tasks to be automatic rather than doing it manual

Page 6: Moving From a Selenium Grid to the Cloud - A Real Life Story

05/01/2023 PROPRIETARY & CONFIDENTIAL6

What is Solution Grid?

Page 7: Moving From a Selenium Grid to the Cloud - A Real Life Story

05/01/2023 PROPRIETARY & CONFIDENTIAL7

Grid Console

Page 8: Moving From a Selenium Grid to the Cloud - A Real Life Story

05/01/2023 PROPRIETARY & CONFIDENTIAL8

Problem with Running Selenium Grid

• Cost

• Single Point of Failure

• High Maintenance

• Flakiness

Page 9: Moving From a Selenium Grid to the Cloud - A Real Life Story

05/01/2023 PROPRIETARY & CONFIDENTIAL9

Solution?

Page 10: Moving From a Selenium Grid to the Cloud - A Real Life Story

05/01/2023 PROPRIETARY & CONFIDENTIAL10

Cost Saving

Save on resources managing VM’s Move to cloud

Page 11: Moving From a Selenium Grid to the Cloud - A Real Life Story

05/01/2023 PROPRIETARY & CONFIDENTIAL11

Scalability

Spin up as many VM’s as you want

Page 12: Moving From a Selenium Grid to the Cloud - A Real Life Story

05/01/2023 PROPRIETARY & CONFIDENTIAL12

System Maintenance

• No worry of system maintenance

• Upgrading of antivirus

• Installing/upgrading browsers

Page 13: Moving From a Selenium Grid to the Cloud - A Real Life Story

05/01/2023 PROPRIETARY & CONFIDENTIAL13

Integration

Page 14: Moving From a Selenium Grid to the Cloud - A Real Life Story

User Control and Security

2016 142016 14

Page 15: Moving From a Selenium Grid to the Cloud - A Real Life Story

Flexibility

2016 152016 15

VS

Page 16: Moving From a Selenium Grid to the Cloud - A Real Life Story

ROI

2016 162016 16

Page 17: Moving From a Selenium Grid to the Cloud - A Real Life Story

© Sauce Labs, Inc.

How execution happen on Sauce Labs

2016 17

Selenium or Appium test scripts.

Instant access to secure, pristine VMs + mobile devices

VM

Improve quality with massive coverage.

Increase velocity by testing in parallel (avg 10x faster)

commands

Sauce ConnectProxy

Test data

Rapidly review, share and debug.

results

Page 18: Moving From a Selenium Grid to the Cloud - A Real Life Story

private static DesiredCapabilities capability = new DesiredCapabilities();

if (browserName != null)capability.setCapability(CapabilityType.BROWSER_NAME, browserName);

if (version != null)capability.setCapability(CapabilityType.VERSION, version);

if (platform != null)capability.setCapability(CapabilityType.PLATFORM, platform);

if (jobName != null)capability.setCapability("name", jobName);

driver = new RemoteWebDriver(new URL(UtilConstants.SAUCE_URL), capability);

http://<SAUCE_USERNAME>:<API_ACCESS_KEY>@ondemand.saucelabs.com:80/wd/hub")

Moving things on cloud using Sauce Labs

2016 18

Page 19: Moving From a Selenium Grid to the Cloud - A Real Life Story

User Name:API Access Key:

2016 19

Random generated combo of number and alphabets (32 digit)anshulsharma

➢ Used to login to your sauce labs account

➢Run tests against your account

➢Upload resources to Sauce Storage

➢Downloads test results, videos and logs

Page 20: Moving From a Selenium Grid to the Cloud - A Real Life Story

Running test on local using Sauce Labs

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"><suite name="Suite" parallel="false"> <test name="Amazon_Search_Test">

<parameter name="browser" value="Chrome" /><parameter name="version" value="36" /><parameter name="platform" value="Windows" /><parameter name="jobName" value="Amazon Search Test" />

<classes> <class name="testSuite.AmazonTest"/> </classes> </test> <!-- Test --></suite> <!-- Suite -->

2016 20

Page 21: Moving From a Selenium Grid to the Cloud - A Real Life Story

Best practices to run tests faster on cloud

2016 21

• Practice modular based testing

• Run Atomic test

• Data driven testing

• Run tests in parallel

• Use POM(Page object model)

Page 22: Moving From a Selenium Grid to the Cloud - A Real Life Story

Summary

• Automating more vs managing more

• Less coding more results

• Speeding up automation development

• Better user control and debugging

2016 22

Page 23: Moving From a Selenium Grid to the Cloud - A Real Life Story

More Info

Contact me @: [email protected]

For Source code reference: https://github.com/asharma28/amazon_search_test

Sauce Labs documentation: https://wiki.saucelabs.com/

2016 23

Page 24: Moving From a Selenium Grid to the Cloud - A Real Life Story

SAUCE LABS RESOURCES

Free Trial of Sauce Labs – saucelabs.com/signup/trial

Sauce Labs Documentation – wiki.saucelabs.com