I had a restless night and started thinking of this idea. I'm wondering if it has been done before.

I'd like to unify native endpoint testing and web testing under 1 tool/framework. Since Selenium already has a nice robust framework, and their Page object model is a good way of creating maintainable webtests. I was thinking.. it should be possible to automate a native application of I add hook (say the application opens an http socket) and a test harness in the AUT which can implement the webdriver interface's methods, like find element by FindBy.xpath, sendKeys(), click().

I'm thinking this could eliminate my need for heavy weight tools such as RFT and QTP to accomplish endpoint automation, and using the Selenium webdriver interface, I can avoid having to redefine all the interfaces and framework code to access that test harness in a structured way and just use the Selenium way of doing things.

Just a thought I'm wondering if it's worth exploring. Some of the layers I think this will involve.

NativeWebDriverLayer - create a open a http connection that can send JSON or SOAP request. Implements the WebDriver interface.

TestHarness (compiled into AUT) - opens a http socket that accepts JSON or SOAP requests. Contains a reference to the top most window of all open windows in the AUT, so it can traverse the GUI tree to find the element. Translates XPATH into the location of a particular GUI element. It can then send window Events like mouse clicks and keyboard events to the target element.