Cannot get scripted test to run


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

// log in
setValue	name="userid"
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

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”.


// bring up the login screen

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

//wait 10 seconds
sleep	10

// navigate to page we want to measure

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

Any advice is appreciated.


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: