create a test and fix the issue with locator injection
Merge branch 'issue853-fix' into 1.7.x