WebPagetest Forums

Full Version: Question regarding setDOMElement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey,
can anyone explain to me how the command "setDOMElement" works in detail?

I tried to understand its behaviour using the example from the documentation:
Code:
setDOMElement    name=loginId
navigate    http://webmail.aol.com

If I execute this script, the test times out...
The DOM element with "name=loginId" does exist on "http://webmail.aol.com"!

See:
http://www.webpagetest.org/result/130124...1/details/

Regards,

Kai
I think it's a bug specific to the Firefox/Chrome implementation. It appears to work correctly in IE: http://www.webpagetest.org/result/130128...d2dbbef6a/

Basically, the code polls the DOM on a regular basis looking for the specified DOM element and it records the time when it becomes available and marks it with a vertical orange line in the waterfall. It also holds the end of the test until it becomes available (or times out).

I opened an issue to track it: http://code.google.com/p/webpagetest/iss...1359386161
Hi,
KaiBra forwarded this issue to me. Is there a way to debug/log/trace wptDriver?

In the source code if found methods like "WptTrace" and a "wpt.log" in "WptSettings::load". Logging with WinDbg ist quite complicated due to tight system integration by dlls.

Kind Regards,
Marek
You have to build a debug version and then the trace messages are viewable in dbgview. They are compiled out in release builds.
The new Revision you commited Wednesday (13.02.2013) fixed this issue. Thank you very much!
The trace messages are only viewable until WptDriver cleans up (WptDriverCore::CleanUp()). Trace messages I'm interested in are those from "WptHook.dll" (e.g. see below "WptTest::ProcessCommand"), when running Firefox (17 and up) tests. I've been trying for quite a long time, but couldn't find any solution to let the WptTrace-Messages appear in DebugView / WinDbg. Creating own log files failed also.

Code:
bool WptTest::ProcessCommand(ScriptCommand& command, bool &consumed) {
  bool continue_processing = true;
  consumed = true;

  WptTrace(loglevel::kFunction, _T("[wpthook] Processing Command '%s'\n"),
                                                              command.command);
  CString cmd = command.command;

Do Firefox Tests use WptHook.dll? / Did WptTrace's "OutputDebugString" generate any Output in injected DLLs under Win7 x86 ?
Yes, they do. In DbgView make sure you have "Capture Global" checked. You will need to launch it "as administrator" if you are on Windows Vista or later.

wpthook.dll is injected into the browser process so you'll be getting the messages from that process, not from the wptdriver process.
I could get "setDomElement" working in Firefox with one code line:
See comment in https://code.google.com/p/webpagetest/is...ail?id=138

The "WptDriver"-Firefox-Extension is able handle a setDomElement command.

Thank you for helping me with debugging!
Thanks for the pointer/patch. I'll get it added to the main codebase later today.
Is that fixed for Chrome and IE10 as well? Just run a simple script test:

setTimeout 20
setEventName test
setDOMElement id=main
navigate http://www.webpagetest.org

and got:

Chrome: timeout http://www.webpagetest.org/result/130515_P8_TVP/
Firefox: ok, but *dom element* occurred before *start render* http://www.webpagetest.org/result/130515_GV_TVX/
IE 9: ok http://www.webpagetest.org/result/130515_6C_V00/
IE 10: timeout http://www.webpagetest.org/result/130515_1X_TW6/
Reference URL's