Is there anybody who can provide a c# example of how to get past the known Selenium issue involving the css pseudo-class :hover?
Essentially, i am working on regression testing for a website startin w/ the selenium IDE (and building the rest of my code in Visual Studio 2008), and need to hover over a div, make it appear, and click a link inside said div.
All of my efforts have failed however, and it seems that many have this issue, with no solution.
Thanks in advance!
Java: These projects are most easily setup using Maven, which will download Java bindings and all dependencies and create the project for you.
...Android Studio(Java and XML).
With that said, Selenium 4 still offers stability because of backwards compatibility. The Java Bindings and the Selenium Server will still provide a mechanism to use the old JSON Wire Protocol. There are multiple contributors to the W3C WebDriver specs, and the whole process can be seen on GitHub.
Selenium 2 also includes Selenium Server, which supports distributed testing via Selenium Grid. The new Selenium Grid supports testing using both the original Selenium RC API and the new WebDriver API.
Okay! So I appreciate the help (I had actually seen that thread, but the .hover() class has been deprecated, and I could not get it to work. I did, however, just find a solid workaround.
var phone = driver.FindElement(By.Id("phones"));
var phoneLi = phone.FindElements(By.TagName("li"));
Actions action = new Actions(driver);//simply my webdriver
action.MoveToElement(phoneLi[1]).Perform();//move to list element that needs to be hovered
var click = action.MoveToElement(phoneLi[1].FindElements(By.TagName("a"))[0];//move to actual button link after the 'Li' was hovered
click.Click();
click.Perform(); //not too sure why I needed to use both of these, but I did. Don't care, it works ;)
IAlert alert = driver.SwitchTo().Alert();
alert.Accept();
Also, you will need to have a couple using statements included.
using OpenQA.Selenium;
using OpenQA.Selenium.Interactions;
using OpenQA.Selenium.Interactions.Internal;
using OpenQA.Selenium.Support.UI;
Hope This Helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With