Refactoring of test code of page loading