Script not working on Firefox/Safari

Hi,

I’m trying to run a simple login test using IE/Chrome/Firefox/Safari. But i’m getting really inconsistent data. Generally, the script works on IE and Chrome and doesn’t on Firefox and Safari.

When it works, it logs in, when it doesn’t work, I can see the user name and password fields are populated, but it appears the form doesn’t get submitted.

Any ideas?

Thanks,

Rich

//test new site!
logData1
navigate http://www.first-utility.com
// off to the login page…
navigate https://www.first-utility.com/login
//login
logData 1
setValue name=LogonForm[uid] username
setValue name=LogonForm[pwd] password
submitForm id=frmLogon
//have also tried submitForm name=logon

Example test runs:
Chrome:
http://www.webpagetest.org/result/140602_7D_CD8/
http://www.webpagetest.org/result/140602_MG_DX0/
Firefox:
http://www.webpagetest.org/result/140602_KY_CK0/
http://www.webpagetest.org/result/140602_2A_DFC/

Scripts can only have one step that produces data (https://sites.google.com/a/webpagetest.org/docs/using-webpagetest/scripting), so you’re first step should have logData 0 before it

You could try using execAndWait document.getElementById(‘frmLogon’).click() to submit the form to see if it makes any difference.

Hi,

I had been trying it with both 0 and 1 and saw the same behaviour. I’ve set it to 0 now but confirm I still see the same problem - firefox is not logging in.

Thanks

Rich

Try doing the form submission with javascript using the execAndWait command. Or better yet, the form fill and submit through script all in one step). That way you can debug locally with firefox and make sure it works before running on WPT (pretty much what Andy recommended).

If pages have pre-submit script that needs to run the behavior can really be tough to debug using the regular commands.

Ah, I see. Ok I’ll give it a go and see how I get on.

Thanks again!

Hi,

I am having a similar issue, in which tests works in Firefox but not in Chrome or IE. I have confirmed that document.querySelector().click() works in Chrome Developer Tools.

Any suggestions?

Can confirm. I’m seeing the similar behavior on the browsers.
I tried using the script, submitForm etc. which did not work

trying each of these steps on debug console in developer tools - works fine.

navigate mydomain.com/path
exec document.getElementById(‘email’).value ="myemail@domain.com"
exec document.getElementById(‘password’).value =“password”
execAndWait document.querySelector(‘#login-button’).click()

document.querySelector works sometimes on Firefox, either on first view or on repeat view. Never together. Chrome, IE & Safari doesn’t work.
document.getElementById(‘login-button’).click() – doesn’t work either – What I see on the agent is that the browser doesn’t wait around for the login to complete

if I add a wait time after the click, the browser takes 10 minutes to finish the test, but the results of post login page are not recorded.