Improvement for window tests for JavaScript-only drivers

1. switch back to main window after opening popup
2. don’t put `javascript:` in `href` attribute of links
Merge pull request #400 from aik099/improve-window-test-for-js-only-driver

Improvement for window tests for JavaScript-only drivers