TRUNK-3949: Backported WebTestHelper changes