Top Banner
MEET THE SELENIUM GRID
45

Meet the Selenium Grid

Feb 18, 2017

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Meet the Selenium Grid

MEET THE SELENIUM GRID

Page 2: Meet the Selenium Grid

AS WEB DEVELOPER || QA WE WANT

Speedometer by Jamie Dickinson flow by Adam Terpenin Responsive Design by Korawan.M

FAST PARALLEL MULTIPLE BROWSERS / OS

Page 3: Meet the Selenium Grid

– Alexey Nikolaenko

“Life is too short to run tests in a single thread”

Page 4: Meet the Selenium Grid

servers by Jaime Carrion

Selenium Nodes

Selenium Hub

Page 5: Meet the Selenium Grid

SELENIUM HUB

• Entry point for tests

• Routes your commands to proper Selenium Node

• Manages sessions

Selenium Hub

Page 6: Meet the Selenium Grid

SELENIUM NODE

• Place where tests are executed

• Holds browser binaries

• Registers itself in Selenium Hub

Nerd Penguin by Hayden Kerrisk

Page 7: Meet the Selenium Grid
Page 8: Meet the Selenium Grid

HOW IT WORKS

• RemoteWebDriver abstraction

• JsonWireProtocol to communicate

Page 9: Meet the Selenium Grid

HOW IT WORKS

Nodes register on grid

Page 10: Meet the Selenium Grid

HOW IT WORKS

User by Wilson Joseph from the Noun Project

Page 11: Meet the Selenium Grid

HOW IT WORKS

Capabilities {platform: “Windows”

browserName: “iexplore”}

/session

Page 12: Meet the Selenium Grid

HOW IT WORKS

Session {sessionId: ‘xyz’,capabilities: {}

}

Page 13: Meet the Selenium Grid

HOW IT WORKS

/session/:sessionId/{command}

Page 14: Meet the Selenium Grid

HOW IT WORKS

Result {…}

Page 15: Meet the Selenium Grid

HOW IT WORKS

DELETE /session/:sessionId

Page 16: Meet the Selenium Grid

OTHER OPTIONS?

Page 17: Meet the Selenium Grid

SAUCE LABS• Automated & Manual testing in browsers

• Supports over 500 browser / platform combinations

• On demand grid

• Reporting (video, screenshots, logs)

• No maintenance costs

• SSL Tunnel for ‘security’ (Sauce Connect)

Page 18: Meet the Selenium Grid

SAUCE LABS

Page 19: Meet the Selenium Grid

“***k PaaS, I want my in-house grid”

Page 20: Meet the Selenium Grid

WHY IN-HOUSE?

• We are Big Enterprise

• Run tests for unlimited time

• N x 1000 concurrent users

• Without SSL tunnels

Page 21: Meet the Selenium Grid

PROBLEMS WITH IN-HOUSE GRID• HUB doesn’t scale well. Single point of failure.

Page 22: Meet the Selenium Grid

HOW TO SCALE HUB?

Page 23: Meet the Selenium Grid

HOW TO SCALE HUB?

… …

Page 24: Meet the Selenium Grid

HOW TO SCALE HUB?

… …

Page 25: Meet the Selenium Grid

HOW TO SCALE HUB?

Grid router

… …

Page 26: Meet the Selenium Grid

HOW TO SCALE HUB?

Grid router

… …

Load Balancer

Page 27: Meet the Selenium Grid

SELENIUM GRID ROUTER

• Routes and proxies Selenium WedDriver requests to multiple Selenium Hubs

• Access control & Quotas

• Developed and used by Yandex

• https://github.com/seleniumkit/gridrouter

Page 28: Meet the Selenium Grid

PROBLEMS WITH IN-HOUSE GRID• HUB doesn’t scale well. Single point of failure.

• Browser windows may loose focus in case of multiple executions

Page 29: Meet the Selenium Grid

AVOID LOOSING FOCUS

• Multiple desktops. Each browser instance has own virtual desktop

• Linux - xvfb

• Windows - desktop-utils.exe (https://github.com/kybu/headless-selenium-for-win)

Page 30: Meet the Selenium Grid

PROBLEMS WITH IN-HOUSE GRID• HUB doesn’t scale well. Single point of failure.

• Browser windows may loose focus in case of multiple executions

• Browser versions management

Page 31: Meet the Selenium Grid

SELENIUM GRID EXTRAS

• Automatically upgrades WebDriver binaries

• Video recording, screenshots

• Centralised configuration

• https://github.com/groupon/Selenium-Grid-Extras

Page 32: Meet the Selenium Grid

PROBLEMS WITH IN-HOUSE GRID• HUB doesn’t scale well. Single point of failure.

• Browser windows may loose focus in case of multiple executions

• Browser version management

• Complex UI component tests

Page 33: Meet the Selenium Grid

COMPLEX UI COMPONENTS?

• Canvas (noVNC, Charts)

• Rich JS components

Page 34: Meet the Selenium Grid

COMPLEX UI COMPONENTS?

• Canvas (noVNC, Charts)

• Rich JS components

Page 35: Meet the Selenium Grid

SELENIUM GRID EXTENSIONSby sterodium.io

Page 36: Meet the Selenium Grid

SELENIUM GRID EXTENSIONS

DOWNLOAD / UPLOAD resource capabilities

Page 37: Meet the Selenium Grid

SELENIUM GRID EXTENSIONS

Extension Proxy

Node Extensions- Sikuli Extension- Files Extension

Page 38: Meet the Selenium Grid

SELENIUM GRID EXTENSIONS• Sikuli requires own virtual desktop.

• Allocate virtual desktop to each Selenium node

• Limit session count to 1 per node

• Launch multiple nodes on different ports

• Images uploaded to Selenium Node.

• Same Sikuli API. Just proxied.

Page 39: Meet the Selenium Grid

• http://sterodium.io/

• https://github.com/sterodium/selenium-grid-extensions

• Examples: https://github.com/echoAlexey/selenium-examples

Page 40: Meet the Selenium Grid
Page 41: Meet the Selenium Grid
Page 42: Meet the Selenium Grid
Page 43: Meet the Selenium Grid
Page 44: Meet the Selenium Grid

Q/A

Page 45: Meet the Selenium Grid

ABOUT ME

• Software Engineer @ Neueda Technologies

• Working on a set of tools for Test Automation.

• @echoAlexey

[email protected]