Question regarding setDOMElement

can anyone explain to me how the command “setDOMElement” works in detail?

I tried to understand its behaviour using the example from the documentation:

setDOMElement name=loginId navigate

If I execute this script, the test times out…
The DOM element with “name=loginId” does exist on “”!




I think it’s a bug specific to the Firefox/Chrome implementation. It appears to work correctly in IE:

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: Google Code Archive - Long-term storage for Google Code Project Hosting.

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,

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.

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

  WptTrace(loglevel::kFunction, _T("[wpthook] Processing Command '%s'\n"), 
  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 Google Code Archive - Long-term storage for Google Code Project Hosting.

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

and got:

Chrome: timeout
Firefox: ok, but dom element occurred before start render
IE 9: ok
IE 10: timeout