![]() |
Script not working on Firefox/Safari - Printable Version +- WebPagetest Forums (https://www.webpagetest.org/forums) +-- Forum: WebPagetest (/forumdisplay.php?fid=7) +--- Forum: Bugs/Issues (/forumdisplay.php?fid=10) +--- Thread: Script not working on Firefox/Safari (/showthread.php?tid=13006) |
Script not working on Firefox/Safari - richiemarshall - 06-02-2014 10:04 PM 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/ RE: Script not working on Firefox/Safari - andydavies - 06-02-2014 11:28 PM 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. RE: Script not working on Firefox/Safari - richiemarshall - 06-03-2014 12:06 AM 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 RE: Script not working on Firefox/Safari - pmeenan - 06-03-2014 06:07 AM 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. RE: Script not working on Firefox/Safari - richiemarshall - 06-03-2014 07:12 AM Ah, I see. Ok I'll give it a go and see how I get on. Thanks again! RE: Script not working on Firefox/Safari - abhagupta - 05-28-2015 11:43 PM 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(<selector>).click() works in Chrome Developer Tools. Any suggestions? (06-03-2014 07:12 AM)richiemarshall Wrote: Ah, I see. Ok I'll give it a go and see how I get on. RE: Script not working on Firefox/Safari - waem445 - 12-10-2015 08:19 AM 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. |