This is something along the lines of calling IWebBrowser2.get_HWND or (more similarly) using XPCOM's nsIAccessibleDocument->GetWindowHandle () calls:
http://msdn.microsoft.com/en-us/library/aa454384.aspx https://developer.mozilla.org/En/NsIAccessibleDocument/windowHandle Both of these provide a mechanism to get a native window handle. The reason for needing this is that webdriver pumps native events to the given HWND, allowing it to closely emulate user behaviour (certainly more closely than doing the same thing by synthesizing events on the DOM) By sending the events to the HWND, it avoids requiring the browser window to have focus. Since webdriver tests tend to run for a long time, it's useful to allow users to do something else with their computer as they run. Regards, Simon On Jul 17, 7:55 pm, John Abd-El-Malek <[email protected]> wrote: > On Fri, Jul 17, 2009 at 10:45 AM, Daniel Wagner-Hall > <[email protected]>wrote: > > > > > Hi, > > > Can anyone help me with this? How can I get the window handle of an > > element from its JS DOM node? > > DOM elements, with the exception of plugins and select controls, don't have > window handles because they're not implemented as native controls (otherwise > we'd run out of OS handles on some pages). > > Are you asking specifically about a plugin node? > > > > > > > Perhaps a little background might help! I'm currently working on > > WebDriver, a browser testing automation tool[1], to add Chrome > > support. As suggested by the chrome team, this is being written as an > > extension with an embedded NPAPI plugin. The original driver worked > > with the AutomationProxy, but this is not available in release > > binaries, which means that a user would need to compile a custom > > version of Chrome; obviously a less than ideal user experience :) > > > We use a native interactions library for sending keys/clicks/etc at > > the OS level, which requires a window handle to the window containing > > the element to do its thing. This library is shared between all the > > drivers for a particular platform (at the moment, only Windows, but X > > support is coming soon). > > > Thanks, > > > Daniel Wagner-Hall > > > 1:http://code.google.com/p/webdriver/ --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: [email protected] View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---
