public void HoverByTest() { var elementActions = new ElementActions(Driver); Driver.Url = "http://the-internet.herokuapp.com/"; elementActions.Click(By.XPath("//a[text()='Hovers']")); Assert.IsFalse(elementActions.IsDisplayed(By.XPath("//h5[text()='name: user1']")), "The specified text isn't displayed."); elementActions.Hover(By.XPath("//div[@class='figure'][1]")); Assert.IsTrue(elementActions.IsDisplayed(By.XPath("//h5[text()='name: user1']")), "The specified text isn't displayed."); }
public void IframeIWebelementTest() { var elementActions = new ElementActions(Driver); Driver.Url = "http://the-internet.herokuapp.com/"; elementActions.Click(By.XPath("//a[text()='Frames']")); elementActions.Click(By.XPath("//li/a[text()='iFrame']")); Assert.IsFalse(elementActions.IsDisplayed(By.Id("tinymce")), "The specified text isn't displayed."); elementActions.SwitchToFrame(Driver.FindElement(By.Id("mce_0_ifr"))); Assert.IsTrue(elementActions.IsDisplayed(By.Id("tinymce")), "The specified text isn't displayed."); }
public void IsDisplayedIWebElementTest() { var elementActions = new ElementActions(Driver); Driver.Url = "http://the-internet.herokuapp.com/"; Assert.IsTrue(elementActions.IsDisplayed(Driver.FindElement(By.XPath("//a[text()='A/B Testing']"))), "The A/B link wasn't displayed."); }