moving from a selenium grid to the cloud - a real life story
TRANSCRIPT
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
05/01/2023 PROPRIETARY & CONFIDENTIAL2
About Emmi Emmi develops patient engagement solutions that help people take active roles in their health and wellbeing.
05/01/2023 PROPRIETARY & CONFIDENTIAL3
About MeLead Automation Engineer
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
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
05/01/2023 PROPRIETARY & CONFIDENTIAL6
What is Solution Grid?
05/01/2023 PROPRIETARY & CONFIDENTIAL7
Grid Console
05/01/2023 PROPRIETARY & CONFIDENTIAL8
Problem with Running Selenium Grid
• Cost
• Single Point of Failure
• High Maintenance
• Flakiness
05/01/2023 PROPRIETARY & CONFIDENTIAL9
Solution?
05/01/2023 PROPRIETARY & CONFIDENTIAL10
Cost Saving
Save on resources managing VM’s Move to cloud
05/01/2023 PROPRIETARY & CONFIDENTIAL11
Scalability
Spin up as many VM’s as you want
05/01/2023 PROPRIETARY & CONFIDENTIAL12
System Maintenance
• No worry of system maintenance
• Upgrading of antivirus
• Installing/upgrading browsers
05/01/2023 PROPRIETARY & CONFIDENTIAL13
Integration
User Control and Security
2016 142016 14
Flexibility
2016 152016 15
VS
ROI
2016 162016 16
© 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
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
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
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
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)
Summary
• Automating more vs managing more
• Less coding more results
• Speeding up automation development
• Better user control and debugging
2016 22
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
SAUCE LABS RESOURCES
Free Trial of Sauce Labs – saucelabs.com/signup/trial
Sauce Labs Documentation – wiki.saucelabs.com