Make it possible to override web driver in tests (#12572)

Change-Id: If696c8a57fc370d2851592d745ab8a2698631ed5