Fixed tests in browsers and SauceLabs
Using `this` can very problematic and is unsafe in many cases.
Merge pull request #6106 from LaurentGoderre/fix-saucelabs

Fixed tests in browsers and SauceLabs