What is the alternative to using hover in selenium c# (hover is now deprecated)?
I'm using Selenium for c# version 1.0.0.0.
I noticed IRenderedWebElement.hover() is deprecated and the deprecated message says to use the "user interactions API instead". When I google "user interactions API" I get this url: http://code.google.com/p/selenium/wiki/AdvancedUserInteractions
ActionChainsGenerator builder = ((HasInputDevices) driver).actionsBuilder();
builder.keyDown(Keys.CONTROL)
.click(someElement)
.click(someOtherElement开发者_开发百科)
.keyUp(Keys.CONTROL);
It gives some sample code on how to use the api but none of the objects it uses are actually in my version of selenium. When I do further research on the objects they exist in the java version of selenium. Why would they deprecate a function and not provide an alternative to the functionality? Does anyone know how to use the user interactions api for the c# version of selenium? Does a new version have it? Is there another solution for hovering? Right now we're just using the deprecated hover function but it doesn't feel right using a deprecated function.
I'll be prompt to accept a solution if one is provided. Thanks.
If the C# version corresponds to the Java version then the reason you don't see those APIs is because they're only available in the current trunk. As I understand it, a new release going to be out 'soon'. You can actually build from the current trunk to get access to these functions (it's very easy to do).
精彩评论