fix(locators): fix regression passing root element to locator scripts

Closes #1378