for a role-protected page, programmatically login user and load page

for a role-protected page, programmatically login user and load page