Deploying Chrome automation in production

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
Grovkillen
Automation Wizard
Posts: 684
Joined: Fri Aug 10, 2012 2:38 pm
Location: Hudiksvall, Sweden
Contact:

Deploying Chrome automation in production

Post by Grovkillen » Mon Apr 26, 2021 3:10 pm

I'm about to deploy a fairly big project at a customers workshop. All in all 20+ Windows tablets and PDA's which will be using Chrome automation to speed up their workflow. I have been kinda scared that keeping the ChromeDriver.exe up to date will be a hassle given that Google Chrome will update itself on a regular basis, the ChromeDriver will not... I found this solution pretty reliable:

Code: Select all

Let>CHROME_DRIVER_URL=https://chromedriver.storage.googleapis.com

  HTTPRequest>%CHROME_DRIVER_URL%/LATEST_RELEASE,,GET,,RESPONSE,,,,
  Separate>RESPONSE,.,VERSION
  Let>CHROME_major=VERSION_1
  Let>CHROME_minor=VERSION_2
  Let>CHROME_build=VERSION_3
  Let>CHROME_revision=VERSION_4
  Let>CHROME_release=RESPONSE
  GoSub>READ_AND_COMPARE_INI_FILE,%ROOT_PATH%\data,info,{"major"},%CHROME_major%,chrome
  IfNotFileExists>%ROOT_PATH%\file_server\chrome\%CHROME_release%.zip
    HTTPRequest>%CHROME_DRIVER_URL%/%LATEST_STABLE_VERSION%/chromedriver_win32.zip,%ROOT_PATH%\file_server\chrome\%CHROME_release%.zip,GET,,,,,,
  Endif>
  Let>NEXT_VERSION=CHROME_major+1
  HTTPRequest>%CHROME_DRIVER_URL%/LATEST_RELEASE_%NEXT_VERSION%,,GET,,RESPONSE,,,,
  IfNot>RESPONSE=404 HTTP/1.1 404 Not Found
    Separate>RESPONSE,.,VERSION
    Let>CHROME_major=VERSION_1
    Let>CHROME_minor=VERSION_2
    Let>CHROME_build=VERSION_3
    Let>CHROME_revision=VERSION_4
    Let>CHROME_release=RESPONSE
    IfNotFileExists>%ROOT_PATH%\file_server\chrome\%CHROME_release%.zip
      HTTPRequest>%CHROME_DRIVER_URL%/%NEXT_DRIVER_VERSION%/chromedriver_win32.zip,%ROOT_PATH%\file_server\chrome\%CHROME_release%.zip,GET,,,,,,
    Endif>
  Endif>
CHANGE YOUR DOWNLOAD PATH ACCORDINGLY!
Let>ME=%Script%

Running: 15.0.19b
version history

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts