Cannot get scripted test to run

Hello,

I have been trying for several days to test a page that is behind an authentication wall.

I’ve tried various scripted test, all on a Private Instance.

First I was using scripts similar to the examples:

// turn off logging
logData	0

// bring up the login screen
navigate	https://www.company.com/login

// log in
setValue	name="userid"	user@company.com
setValue	name="password"	pa$$word
submitForm	id="loginForm"
// also tried
//clickAndWait	id="btnlogin"

// turn on logging
logData	1

// navigate to page we want to measure
navigate	https://www.company.com/slowpage.html

However, I could not get the login to work. The test would always show the login page.

The closest I’ve got is the following script, which kind of works in IE, but doesn’t work in Chrome. The following script actually loads the slowpage.html I’d like to test in IE, but only partially; also, I need to emulate mobile devices so I need to use Chrome. In Chrome I always get “The testing completed but failed. Skipped repeat view, first view failed: Test run failed with result code -1”.

combineSteps

// bring up the login screen
navigate	https://www.company.com/login

// log in using jQuery, this code does work in the console
exec	$('input#userID').val("user@company.com"); $('input#password').val("pa$$word"); $('button#btnlogin').click()

//wait 10 seconds
sleep	10

// navigate to page we want to measure
navigate	https://www.company.com/slowpage.html

Any other tips or tricks? Suggestions on how to debug?

Any advice is appreciated.

Thanks,

Try logging in manually and saving the authentication cookie. Then use WPT scripting to set the auth cookie and navigate directly to the page you want to test. The script is two lines and you don’t have to worry about a warm cache.

See this post for more info: http://calendar.perfplanet.com/2015/using-webpagetest-authentication/