16
Introduction to - Sajnikanth Suriyanarayanan Presented at AlbumPrinter QA Guild on 20th Nov 2014

Introduction to saucelabs

Embed Size (px)

Citation preview

Page 1: Introduction to saucelabs

Introduction to - Sajnikanth Suriyanarayanan

Presented at AlbumPrinter QA Guild on 20th Nov 2014

Page 2: Introduction to saucelabs

Contents● Why Saucelabs?● Demo script● Using Sauce to run demo script● Introduction to holmium● Running script with holmium on sauce● Questions

Page 3: Introduction to saucelabs

Why Sauce?

Page 4: Introduction to saucelabs

● Cross browser● Cross platform● Parallel testing● yada yada…

There’s also Browserstack, Browsershots, Browserling etc.

...

Page 5: Introduction to saucelabs

Let’s get our hands dirty

Page 6: Introduction to saucelabs

Demo Setup & Introsudo pip install nose selenium holmium.coregit clone https://github.com/sajnikanth/sauce-demo

● Setup○ Use local Firefox

● Test Steps○ Go to Vistaprint Corp Page○ Click on “sign in” button○ On Login Page, enter username, password and login○ Check if “Welcome message is displayed”

● Tear Down○ Quit Browser

Page 7: Introduction to saucelabs

Running Demo Script locally

python tests/selenium_vistaprint_test.py

ornosetests tests/selenium_vistaprint_test.py

Page 8: Introduction to saucelabs

Saucelabs Setup

● Register at https://saucelabs.com○ Have username handy

● Go to https://saucelabs.com/account● Get Access Key

sudo pip install sauceclient

Page 9: Introduction to saucelabs

Demo Script on Sauce● Setup

○ Check if sauce credentials are available during runtime■ Env - Windows & Chrome

○ If credentials are not available■ Use local Firefox

● Test Steps○ Go to Vistaprint Corp Page○ Click on “sign in” button○ On Login Page, enter username, password and login○ Check if “Welcome message is displayed”

● Tear Down○ Check if sauce credentials are available during runtime

■ Update results on Sauce○ Quit Browser

Page 10: Introduction to saucelabs

Running on Saucenosetests tests/selenium_vistaprint_test.py \

-cred=<ENTER SAUCE USERNAME>:<ENTER SAUCE ACCESS KEY>

Page 11: Introduction to saucelabs

● Test Steps○ Go to <URL>○ Click on “sign in” button○ Login with <username> and <password>○ Check if “Welcome message is displayed”○ Update results on Saucelabs, if possible

Demo Script with HolmiumHolmium is a plugin for nosetests; can easily create page objects

Page 12: Introduction to saucelabs

...

Page 13: Introduction to saucelabs

Demo Script with Holmium on Sauce

nosetests tests/holmium_vistaprint_test.py\

--with-holmium --holmium-browser=firefox\

--holmium-environment=http://vistaprint.com\

--holmium-remote=http://<ENTER SAUCE USERNAME>:<ENTER SAUCE ACCESS KEY>@ondemand.saucelabs.com:80/wd/hub\

--holmium-capabilities='{"platform":"OS X 10.10", "name":"vistaprint_login"}'

Page 14: Introduction to saucelabs

...

Page 15: Introduction to saucelabs

Recap

● Demo script run locally on Firefox (hard-coded)

● Demo script run on Sauce on Windows / Chrome (hard-coded)

● Demo script with holmium on Sauce on OSX / Firefox (command line parameter)