WebPagetest Forums
Issues logging in - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: General Discussion (/forumdisplay.php?fid=25)
+--- Thread: Issues logging in (/showthread.php?tid=13431)



Issues logging in - johnlenehan - 12-09-2014 02:52 AM

Hi

I have a Moodle website that I want to log into and then measure a page load speed.

I have been using the following script to achieve this:

logData 0
navigate https://edu.eupati.eu/login/index.php
sleep 15
logData 0
setValue id=username xxxxxxxxxxxxx
setValue id=password xxxxxxxxxxxxx
submitForm name=login
sleep 15
logData 1
navigate https://edu.eupati.eu/mod/book/view.php?id=1197&chapterid=773

I replaced the username and passwords with the actual username and password or should they be encoded?

I cannot seem to get past the login page.

Any help you can give me is greatly appreciated.

Thanks
J


RE: Issues logging in - andydavies - 12-09-2014 11:59 PM

So I mostly use the exec script command to manipulate DOM elements when I script these days so I'd do something like this for the above case

logData 0
navigate https://edu.eupati.eu/login/index.php
sleep 15
logData 0
exec document.getElementById('username').value='xxxxxx'
exec document.getElementById('password').value='xxxxxx'
execAndWait document.getElementById('loginbtn').click()
sleep 15
logData 1
navigate https://edu.eupati.eu/mod/book/view.php?...pterid=773


RE: Issues logging in - johnlenehan - 12-10-2014 02:22 AM

Thanks a million for your help Andy.

Your script is working as intended now.

Thanks again

J


RE: Issues logging in - josephscott - 12-11-2014 06:32 AM

This is an excellent example, thank you for posting this. It would be worth adding this as an example in the docs - https://sites.google.com/a/webpagetest.org/docs/using-webpagetest/scripting#TOC-MyAOL-Authenticated-profile