From 61883437cc705e83b3051d5d70696b8400f51980 Mon Sep 17 00:00:00 2001 From: vdot0x23 <40716069+vdot0x23@users.noreply.github.com> Date: Fri, 19 Jun 2020 11:25:41 +0000 Subject: [PATCH] [DEV] Set chromedriver path with env variable (#1123) --- internal/suites/webdriver.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/suites/webdriver.go b/internal/suites/webdriver.go index 54fdce6fd..822f04bf9 100644 --- a/internal/suites/webdriver.go +++ b/internal/suites/webdriver.go @@ -21,7 +21,12 @@ type WebDriverSession struct { // StartWebDriverWithProxy create a selenium session. func StartWebDriverWithProxy(proxy string, port int) (*WebDriverSession, error) { - service, err := selenium.NewChromeDriverService("/usr/bin/chromedriver", port) + driverPath := os.Getenv("CHROMEDRIVER_PATH") + if driverPath == "" { + driverPath = "/usr/bin/chromedriver" + } + + service, err := selenium.NewChromeDriverService(driverPath, port) if err != nil { return nil, err