Use createHTMLDocument only when available
Add more repeat tests
Ensure test is not void