Current time: 12-16-2017, 07:04 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot get scripted test to run
07-06-2016, 01:03 PM
Post: #1
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:

Code:
// 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".

Code:
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,
Find all posts by this user
Quote this message in a reply
07-17-2016, 06:17 PM
Post: #2
RE: Cannot get scripted test to run
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/usin...ntication/

Rick Viscomi
Author, Using WebPageTest
http://usingwpt.com
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)