I am trying to test a webpage with SSO login. Whenever the url is hit and if the user is already logged in as SSO it redirects the user to the actual page. Until then the user is shown Loading Page msg.
I scripted a GET request in the script as below:
export function opsPortal_TenantsOverview() {
let response
response = http.get('https://my_url', {
headers: {
Authorization:
'Bearer MYTOKEN', //To simulate user login using JWT tokens
},
})
console.log(response.body);
check(response, { 'status equals 200': response => response.status.toString() === '200' })
const doc = parseHTML(response.body); // equivalent to res.html()
const pageTitle = doc.find('head title').text();
console.log('Page Title - ' + pageTitle);
// Automatically added sleep
sleep(1)
}
When I run the script, it can verify that response code is 200.
But it cannot check whether the next screen post user authentication. I need to simulate the user SSO which redirects the user to a new screen with actual data where I need to measure the page loading time…Any ideas pls??