Library

Course: Selenium Grid - From Scratch - Deployment & Configuration

Selenium Grid - From Scratch - Deployment & Configuration

  • Life Time Access
  • Certificate on Completion
  • Access on Android and iOS App
  • Self-Paced
About this Course

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

Who this course is for:

  • QA Automation, DevOps, Automation Developers, Mobile Developers
Basic knowledge
  • Basic command line skills, some coding skills (an advantage)
What you will learn
  • Setup, Deploy & Configure fully functional Selenium Grid including mobile emulators & mobile real deceives
Curriculum
Number of Lectures: 34
Total Duration: 01:53:04
Introduction
  • Introduction  

    General overview of the course content.

  • Resource Files  

    You can download all the Resource Files here.

Selenium Grid & Web-Drivers
  • Download & Setup: Selenium Standalone  

    Download latest Selenium Standalone & setup initial folders layout

    https://www.seleniumhq.org/

  • Download & Setup Web-Driver: Internet Explorer  

    Download latest IEDriverServer.exe & setup initial folders layout

    https://www.seleniumhq.org/

  • Download & Setup Web-Driver: Google Chrome  

    Download latest chromedriver.exe & setup initial folders layout

    http://chromedriver.chromium.org/downloads

  • Download & Setup Web-Driver: Mozilla Firefox  

    Download latest geckodriver.exe & setup initial folders layout

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

  • 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
  • Download & Setup: Node-js  

    Download latest Node.js & setup initial folders layout

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

Java SDK Download & Setup
  • 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.

  • Java SDK Download & Setup: Environment Variables  

    Setup environment variables to allow automaton

    JAVA_HOME

Android SDK Download & Deployment
  • Download & Setup: Android-SDK  

    Download latest Android SDK CLI & setup initial folders layout

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

  • 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

  • Install: Intel® Hardware Accelerated Execution Manager  

    Install HAXM to allow android emulator to run properly.

  • 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"

  • 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"

  • Setup: Environment Variables  

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

    ANDROID_HOME

    %JAVA_HOME%\bin

Python Download & Setup
  • Download & Setup: Python  

    Download Python 2.7.8, setup initial folders layout & install

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


  • Python Download & Setup: Environment Variables  

    Setup python under environment path


Selenium Grid Deployment
  • Setup: System Variables - Path  

    Add all relevant entries into path system variable


  • 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-env\android-device

  • Download & Setup: Appium-Doctor  

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


    command line

    npm install appium-doctor

  • Download & Setup: Appium  

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


    command line

    npm install appium


  • 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"

    }


  • 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": {}

    }


  • 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"

      }

    }


  • Selenium Grid Setup: Run-hub.bat  

    NOTE: There was no Audio for this lecture when I recorded this. I'm sorry about that. However, you can watch the video for your reference. I Have added a new lecture after this which has audio in it.


    create the batch file to run selenium hub


    command line

    java -jar D:\automation-env\selenium-server-standalone-3.141.5.jar -role hub -hubConfig D:\automation-env\configurations\config-hub.json


  • Selenium Grid Setup: Run-hub.bat - Pt 2  

    create the batch file to run selenium hub


    command line

    java -jar D:\automation-env\selenium-server-standalone-3.141.5.jar -role hub -hubConfig D:\automation-env\configurations\config-hub.json


  • Selenium Grid Setup: Run-node.bat  

    create the batch file to run selenium node


    command line

    java -Dwebdriver.gecko.driver="D:\automation-env\web-drivers\geckodriver.exe" -Dwebdriver.chrome.driver="D:\automation-env\web-drivers\chromedriver.exe" -Dwebdriver.ie.driver="D:\automation-env\web-drivers\IEDriverServer.exe" -Dwebdriver.edge.driver="D:\automation-env\web-drivers\MicrosoftWebDriver.exe" -jar "D:\automation-env\selenium-server-standalone-3.141.5.jar" -role webdriver -port 5566 -nodeConfig D:\automation-env\configurations\config-node.json


  • Selenium Grid Setup: Run-node-appium.bat  

    create the batch file to run appium node


    command line

    appium -a localhost --nodeconfig D:\automation-env\configurations\config-node-appium.json


  • Selenium Grid Setup: Run-grid.bat  

    create the batch file to run the whole grid


    command line

    start D:\automation-env\batch-files\run-hub.bat

    start D:\automation-env\batch-files\run-node-appium.bat

    start D:\automation-env\batch-files\run-node.bat


  • Selenium Grid Setup: Run-emulator.bat  

    create the batch file to run android emulator


    command line

    D:\automation-env\android-sdk\platform-tools\adb.exe start-server

    D:\automation-env\android-sdk\emulator\emulator -avd auto-deployed-avd -netdelay none -netspeed full


  • Selenium Grid Setup: Deploy on Another Machine  

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

    • copy automation-env to new computer ( on the same partition)
    • install python
    • install HAXM
    • install java
    • configure config-hub.json
    • configure config-node.json
    • configure config-node-appium.json
    • configure run-node-appium-bat
    • delete .android folder if exists
    • reinstall android image
    • re-create repositories.cfg
    • set JAVA_HOME
    • set ANDROID_HOME
    • set path
Selenium Grid Verification
  • 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


  • 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)

Reviews (0)