Reputation: 97
So I've been able to monitor Selenium WebDriver events via the EventfiringWebdriver, however I am in need of monitoring Seleniums' Actions class..
For Instance Say I am performing an mouse hover via,
Actions act = new Actions(driver);
act.MoveToElement(driver.findElement(By.XPath(""))).Perform();
Now I am in need of Listening for the MoveToElement event so that I can add in some timing and other various behaviors when using the MoveToElement method. Any help would be greatly appreciated, just looking to be pointed in the right direction, an example or link would be great as well. Thanks for the help in advance !
Upvotes: 1
Views: 1850
Reputation: 793
Personally I would implement this as a wrapper with delegate code execution instead of trying to get the listener to pick this up. You could overload the perform()
method by extending the class and then use that one instead which would allow you to do whatever waits you want based on the calling function.
However, if you really want it as an event then I think you might have to extend the base class EventFiringWebDriver
with an actions method to pick up the actions calls and then do something with them.
https://selenium.googlecode.com/svn/tags/android-froyo/docs/api/dotnet/html/AllMembers_T_OpenQA_Selenium_Support_Events_EventFiringWebDriver.htm
Upvotes: 1