WebPagetest Forums
scripted test times out in Chrome/FF - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Bugs/Issues (/forumdisplay.php?fid=10)
+--- Thread: scripted test times out in Chrome/FF (/showthread.php?tid=10213)

scripted test times out in Chrome/FF - nilskuhn - 12-14-2011 06:48 PM

I am using WPT Server and Agents in version 2.5. I've set up some windows 7-agents with IE8, Chrome and FF7. I am running the following script:

logData    0
navigate    http://www.otto.de
clickAndWait id=TconHrefModul_02
logData    1
setValue    name=fh_search    shirt
clickAndWait    id=top_search_submit

IE8 works fine and provides valid results. The wptdriver-controlled browsers Chrome and FF7 do not run the tests completely and time out. I've tried the script with the public instance on webpagetest.org, location Dulles. Unfortunately with the same result:

Is there a way to get the logging of wptdriver? Any ideas why the scripts aren't running?

Thanks in advance,
FF7 runs the navigate and the first clickAndWait, the input-element with name-attribute "fh_search" gets the focus and FF seems to hang-up.
Chrome doesn't perform the first clickAndWait.
With FF7 I see many requests to google-safebrowsing (til timeout) in detailed results. Even if I disable safebrowsing by setting browser.safebrowsing.enabled and browser.safebrowsing.malware.enabled to false these requests arise!?

RE: scripted test times out in Chrome/FF - pmeenan - 12-15-2011 12:57 AM

sorry, script debugging kind of sucks right now. I have it on our to-do list to build a chrome extension that lets you test out scripts in a browser but haven't had time to get to it. I'll take a look at debugging it today.

Do you know if the element is inside of an IFrame? It's possible that the Chrome and Firefox extensions are not (or can not) reaching inside of IFrames but the IE agent does. The other possibility is just in how the events are fired.

RE: scripted test times out in Chrome/FF - nilskuhn - 12-15-2011 01:07 AM

No IFrames on the pages. It would be great if you get around to debug that for me, thanks in advance!

RE: scripted test times out in Chrome/FF - pmeenan - 12-16-2011 04:00 AM

Hate to do it to you, but you might be better off using execAndWait with javascript (at least for now). Clock sends a click event to elements but that doesn't trigger anchor tags to load the href (at least in chrome).

We can see about having it cascade to navigating href if the click event doesn't work but in the meantime something like this should work:

logData    0
navigate    http://www.otto.de
execAndWait    window.location=document.getElementById('TconHrefModul_02').href;
logData    1
setValue    name=fh_search    shirt
submitForm    id=topSearch

RE: scripted test times out in Chrome/FF - nilskuhn - 12-16-2011 06:30 AM

Thanks a lot for the quick answer and for the tip with execAndWait and the execution of javascript!

But especially with anchor tags we have a problem adressing them with Javascript. Just few of them have id's :-(
With wpt-script-command clickAndWait we can use attributes like name or even alt to adress the anchor tag.

Regards, Nils

RE: scripted test times out in Chrome/FF - pmeenan - 12-17-2011 12:08 AM

I opened a bug so we'll get it working but short-term I don't think there are alternatives other than writing custom js.


RE: scripted test times out in Chrome/FF - nilskuhn - 12-17-2011 12:17 AM

OK, thanks. For me that's not a high-priority-bug. We've thought about it and we'll get the most of our relevant elements adressed via javascript/jquery.

RE: scripted test times out in Chrome/FF - nilskuhn - 12-20-2011 10:25 PM


something special to regard, using jQuery-Calls in WPT-Scripts for wptdriver-controlled browsers?

navigate    http://www.otto.de/
execAndWait    document.getElementById('TconHrefModul_02').click();
exec    document.getElementById('searchValue').value='shirt';
execAndWait    document.getElementById('top_search_submit').click();
execAndWait    $("img[alt='Laura Scott Shirt (2 Stck.)']")[0].click();

works in IE8 but not in Chrome/FF7.

Regards, Nils

RE: scripted test times out in Chrome/FF - pmeenan - 12-21-2011 01:53 AM

Shouldn't be but when I try running those commands in the dev console in Chrome they don't work (largely because you can't call click from javascript). The first command comes back with:

TypeError: Object http://www.otto.de/Damen/shop-de_bc_sh1458583/;sid=RHREFl272y7-FBNL6qR8fzGxykWV3iv9omFWbp5OAXI76tuwzF429Yo5AXI76qLnpx2i_dOj has no method 'click'

The great thing with the exec commands is that you can debug them directly in the browser's dev tools console :-)