WebDriver driver = new FirefoxDriver();--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0eb9d038-4b9c-4d76-ba0e-b8a38efc7568%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
WebDirver driver = new new FirefoxDriver();
WebDriverListener eventListener = new MyOwnImplementationOfWebDriverListener(driver);
EventFiringWebDriver eventDriver = new EventFiringWebDriver(driver);
eventDriver.register(eventListener);
eventFiringWebDriver.get("http://www.google.com");
WebElement elem = eventFiringWebDriver.findElement(By.name("q"));
elem.click();I'm not familiar with the listeners. I know that people have tended to use something like BrowserMob Proxyto act as a man-in-the-middle to capture and replay HTTP actions. Since WebDriver runs using the JSON Wire Protocol, I think this may be more suited for what you're looking for.
Also, Simon Stewart (the creator of WebDriver) has a detailed write-up on the philosophies and architecture of the Selenium WebDriver project. You can see that here.
Cheers, Dave H
I guess you want to capture the action which manually performed by the end user on the browser (opened by webdriver), the simple answer is not easy. The manual action (click, input etc) will not trigger the listener in your test codes. Your code could be considered as a client and the browser will be server. They are single direction call from the client to the server.
One way is you inject some javascript code to the browser (via web driver) and capture those actions and send it back to somewhere. It is a little complicated but actually works.
Best Regards,
--david