diff --git a/javascript/node/selenium-webdriver/lib/by.js b/javascript/node/selenium-webdriver/lib/by.js index 9dcad40e73d9d..fcc4304780d9f 100644 --- a/javascript/node/selenium-webdriver/lib/by.js +++ b/javascript/node/selenium-webdriver/lib/by.js @@ -396,7 +396,7 @@ class RelativeBy { * strategy. */ function check(locator) { - if (locator instanceof By || typeof locator === 'function') { + if (locator instanceof By || locator instanceof RelativeBy || typeof locator === 'function') { return locator }