3.85 out of 5
3.85
12 reviews on Udemy

Selenium Grid – From Scratch – Deployment & Configuration

selenium grid, automation, automation testing, devops, qa automation, selenium, web driver, json wire protocol, appium
Instructor:
Roei Sabag
60 students enrolled
English [Auto-generated]
Setup, Deploy & Configure fully functional Selenium Grid including mobile emulators & mobile real deceives

this short course was designed to aggregate – once and for all – the complete process of deploying selenium grid. all the small things, tricks, dependencies, gaps and so on, will be answered in this course. teaching you, step by step how to build a fully functional gird from scratch including all browsers, mobile web & mobile native applications (using appium) under a single grid.

you will also learn how to deploy android emulators (without android studio), setup environment variables, node-js, java, python, etc. to fully setup your gird.

this course is not development language dependent and it is relevant for web-driver based automation development regardless of the language or platforms used for development

Introduction

1
introduction

general overview of the course content

selenium grid & web-drivers

1
download & setup: selenium standalone

download latest Selenium Standalone & setup initial folders layout

https://www.seleniumhq.org/

2
download & setup web-driver: internet explorer

download latest IEDriverServer.exe & setup initial folders layout

https://www.seleniumhq.org/

3
download & setup web-driver: google chrome

download latest chromedriver.exe & setup initial folders layout

http://chromedriver.chromium.org/downloads

4
download & setup web-driver: mozilla firefox

download latest geckodriver.exe & setup initial folders layout

https://github.com/mozilla/geckodriver/releases

5
download & setup web-driver: microsoft edge

download latest MicrosoftWebDriver.exe & setup initial folders layout

https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

node-js download & deployment

1
download & setup: node-js

download latest Node.js & setup initial folders layout

https://nodejs.org/en/download/

android sdk download & deployment

1
download & setup: android-sdk

download latest Android SDK CLI & setup initial folders layout

https://developer.android.com/studio/

2
download & setup: intel® hardware accelerated execution manager

download latest Intel Hardware Accelerated Execution Manager & setup initial folders layout

https://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager-intel-haxm

3
install: intel® hardware accelerated execution manager

install HAXM to allow android emulator to run properly

4
download & setup: android packages - part #1

install all relevant android-sdk package to allow mobile-native & mobile-web automation


command line

sdkmanager.bat "platform-tools" "platforms;android-26" "platforms;android-27" "platforms;android-28" "emulator" "system-images;android-28;google_apis_playstore;x86"

5
download & setup: android packages - part #2

install all relevant android-sdk package to allow mobile-native & mobile-web automation


command line

sdkmanager.bat "platform-tools" "platforms;android-26" "platforms;android-27" "platforms;android-28" "emulator" "system-images;android-28;google_apis_playstore;x86"

6
setup: environment variables

setup environment variables to allow mobile-native & mobile-web automaton

ANDROID_HOME

%JAVA_HOME%bin

java sdk download & setup

1
download & setup: java-jdk

download latest java-jdk, setup initial folders layout & install

https://www.oracle.com/technetwork/java/javase/downloads/index.html


Update 2018-11-18

Since I have found some issues with Selenium & Java 11+ it is recommended to use JDK 8 instead and not the version I show in this lecture. The installation and download process is the same, so you can follow the lecture, just make sure to download the supported version.

https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html


to find out what is the recommended java version, please visit here (scroll a bit down to see which JDK to use):

https://github.com/SeleniumHQ/selenium#selenium--


other than that, all versions and tools in the course are valid

2
setup: environment variables

setup environment variables to allow automaton

JAVA_HOME

python download & setup

1
download & setup: python

download Python 2.7.8, setup initial folders layout & install

https://www.python.org/ftp/python/

2
setup: environment variables

setup python under environment path

selenium grid deployment

1
setup: system variables - path

add all relevant entries into path system variable

2
setup: android emulator

create an android emulator for mobile-native & mobile-web automation


command line

avdmanager.bat create avd -n auto-deployed-avd -k "system-images;android-28;google_apis_playstore;x86" -p D:automation-envandroid-device

3
download & setup: appium-doctor

install appium-doctor package to insure and check for appium environment setup problems


command line

npm install appium-doctor

4
download & setup: appium

install appium allows mobile-web & mobile-automation locally or via selenium grid


command line

npm install appium

5
selenium grid setup: config-hub.json

create configuration file for selenium grid hub role


configuration

{

    "host": "localhost",

    "maxSessions": 5,

    "port": 4444,

    "cleanupCycle": 5000,

    "timeout": 300000,

    "newSessionWaitTimeout": -1,

    "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",

    "throwOnCapabilityNotPresent": true,

    "nodePolling": 180000,

    "servlets": [],

    "prioritizer": null,

    "platform": "WIN10"

}

6
selenium grid setup: config-node.json

create configuration file for selenium grid node role


configuration

{

    "capabilities":[

    {

        "webdriver_firefox_port":  9513,

        "seleniumProtocol":  "WebDriver",

        "marionette":  true,

        "maxInstances":  1,

        "platform":  "WIN10",

        "browserName":  "firefox"

    },

    {

        "seleniumProtocol":  "WebDriver",

        "platform":  "WIN10",

        "browserName":  "chrome",

        "maxInstances":  1

    },

    {

        "seleniumProtocol":  "WebDriver",

        "platform":  "WIN10",

        "browserName":  "internet explorer",

        "maxInstances":  1

    },

    {

        "seleniumProtocol":  "WebDriver",

        "platform":  "WIN10",

        "browserName":  "MicrosoftEdge",

        "maxInstances":  1

    }

],

    "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",

    "maxSession": 4,

    "port": -1,

    "register": true,

    "registerCycle": 5000,

    "hub": "http://localhost:4444",

    "nodeStatusCheckTimeout": 5000,

    "nodePolling": 5000,

    "role": "node",

    "unregisterIfStillDownAfter": 60000,

    "downPollingLimit": 2,

    "debug": false,

    "servlets" : [],

    "withoutServlets": [],

    "custom": {}

}

7
selenium grid setup: config-node-appium.json

create configuration file for selenium grid appium node


configuration

{

    "capabilities":[

    {

        "platform": "ANDROID",

        "deviceName":  "android-device-web",

        "nativeDevice": false,

        "platformVersion": "5.1.1",

        "maxInstances": 1,

        "browserName": "chrome"

    },

    {

        "appActivity": ".Calculator",

        "platformVersion": "5.1.1",

        "platform": "ANDROID",

        "deviceName": "android-device-native",

        "appPackage": "com.sec.android.app.popupcalculator",

        "browserName": "android",

        "maxInstances": 1,

        "applicationName": "popupcalculator",

        "nativeDevice": true

    }

],

    "configuration":

    {

        "cleanUpCycle": 2000,

        "timeout": 30000,

        "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",

        "host": "localhost",

        "port": 4723,

        "maxSession": 1,

        "register": true,

        "registerCycle": 5000,

        "hubPort": 4444,

        "hubHost": "localhost"

    }

}

8
selenium grid setup: run-hub.bat

create the batch file to run selenium hub


command line

java -jar D:automation-envselenium-server-standalone-3.141.5.jar -role hub -hubConfig D:automation-envconfigurationsconfig-hub.json

9
selenium grid setup: run-node.bat

create the batch file to run selenium node


command line

java -Dwebdriver.gecko.driver="D:automation-envweb-driversgeckodriver.exe" -Dwebdriver.chrome.driver="D:automation-envweb-driverschromedriver.exe" -Dwebdriver.ie.driver="D:automation-envweb-driversIEDriverServer.exe" -Dwebdriver.edge.driver="D:automation-envweb-driversMicrosoftWebDriver.exe" -jar "D:automation-envselenium-server-standalone-3.141.5.jar" -role webdriver -port 5566 -nodeConfig D:automation-envconfigurationsconfig-node.json

10
selenium grid setup: run-node-appium.bat

create the batch file to run appium node


command line

appium -a localhost --nodeconfig D:automation-envconfigurationsconfig-node-appium.json

11
selenium grid setup: run-grid.bat

create the batch file to run the whole grid


command line

start D:automation-envbatch-filesrun-hub.bat

start D:automation-envbatch-filesrun-node-appium.bat

start D:automation-envbatch-filesrun-node.bat

12
selenium grid setup: run-emulator.bat

create the batch file to run android emulator


command line

D:automation-envandroid-sdkplatform-toolsadb.exe start-server

D:automation-envandroid-sdkemulatoremulator -avd auto-deployed-avd -netdelay none -netspeed full

13
selenium grid setup: deploy on another machine

check list of how to replicate the automation environment to other machines

  1. copy automation-env to new computer ( on the same partition)

  2. install python

  3. install HAXM

  4. install java

  5. configure config-hub.json

  6. configure config-node.json

  7. configure config-node-appium.json

  8. configure run-node-appium-bat

  9. delete .android folder if exists

  10. reinstall android image

  11. re-create repositories.cfg

  12. set JAVA_HOME

  13. set ANDROID_HOME

  14. set path

selenium grid verification

1
wire protocol direct test

send requests to your grid in order to make sure all drivers and tool are properly working


postman download page

https://www.getpostman.com/apps

2
troubleshooting: no Chromedriver found that can automate Chrome 'xx.x.xxxx'

attend an error which happens when there is no available chrome-driver for mobile-web (android)

You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
3.9
3.9 out of 5
12 Ratings

Detailed Rating

Stars 5
6
Stars 4
3
Stars 3
1
Stars 2
1
Stars 1
1
a0042017bccdf742c9ee98a3b320c91c
30-Day Money-Back Guarantee

Includes

2 hours on-demand video
Full lifetime access
Access on mobile and TV
Certificate of Completion