1

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.

Adam
  • 255
  • 1
  • 3
  • 17

1 Answers1

1

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).

Mike Kwan
  • 24,123
  • 12
  • 63
  • 96
  • When I go to the latest builds on the selenium site (http://xserve.openqa.org:8085/) there is no download link for the c# project. I also tried clicking the "Source Code" link which brought me here: http://selenium.googlecode.com/svn/trunk/. Nothing in there related to c# that I could find. Btw I don't have version 1.0.0.0 like I said in the OP. That was the dll version, the actual version i'm using is selenium-dotnet-2.0b3 – Adam Jun 01 '11 at 12:08
  • The trunk is not prebuilt. It is very easy to grab a SVN client like TortoiseSVN and point it to http://selenium.googlecode.com/svn/trunk/. Once you have downloaded it, just go to command prompt, navigate to the root of where you downloaded and type 'go release' and the whole thing will compile. – Mike Kwan Jun 01 '11 at 12:25
  • I just noticed the dotnet folder. Thanks. Marked as answer. – Adam Jun 01 '11 at 12:55
  • As a follow up to this, the classes I wanted were in the version of Selenium I had all along except they were named differently. Include the OpenQA.Selenium.Interactions namespace and look at the classes in there. The one equivelant to the ActionChainsGenerator was DefaultActionSequenceBuilder. – Adam Jun 01 '11 at 13:30