selenium: Fix tests on macOS + Node.js v18
Tests work just fine on Linux + Node.js v16 and v18.
Tests work just fine on macOS + Node.js v16.
All tests are broken on macOS + Node.js v18.
This commit fixes tests on macOS + Node.js v18.
The commit should be removed as soon as T324766 is resolved.
Bug: T355556
Change-Id: I54437ba60164a4a89b3aacf05d6b3f3abde254ac