Hey,
The alternative that comes to my mind is to use JavaScript to put element into focus. I'd like to put emphasis on the word "focus", as there's no way to actually move mouse cursor to an element using JavaScript. But I believe Actions.MoveToElement() does something similar just focusing the element.
1) Anyway, you may want to have a look at JS method
document.getElementById("myAnchor").focus();
And call this JS method from your test code using something like:
((IJavaScriptExecutor)driver).ExecuteScript("el.focus();", el); //el - is you IWebElement that you want to focus on
You can read some info about this method in W3C schools and also try running example code to understand how it all works:
https://www.w3schools.com/jsref/met_html_focus.aspIf you try the example (
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_html_blur) code provided by W3C you'll notice that on clicking "Get focus" button your focus goes to "
Visit W3Schools.com" link that potentially will be exactly the behavior you are after.
2) I think there's a serious reason for not upgrading your GeckoDriver/Selenium in your case, but out of curiosity - what's preventing you from using the latest 0.17 GeckoDriver that works with Actions class methods just fine? (
https://github.com/mozilla/geckodriver/releases). Upgrading would really make your life easier :)
Cheers.