Move to Element and Click



MovetoElement and Click

[Test]
public void MovetoElementAndClick()
{
dr.Navigate().GoToUrl(“https://www.browserstack.com/”);
Actions action = new Actions(dr);
IWebElement element = dr.FindElement(By.XPath(“//a[@id=’signupModalButton’]”));
action.MoveToElement(element).Click().Build().Perform();
string expectedURL = “https://www.browserstack.com/users/sign_up”;
string actualURL = dr.Url;
Assert.AreEqual(expectedURL, actualURL,”User is not navigated to signup page”);
}

Tags: ,
Leave a comment

Your email address will not be published. Required fields are marked *

Subscribe now

Receive weekly newsletter with educational materials, new courses, most popular posts, popular books and much more!