I want to build a test case where the mouse cursor moves with the element and then assert that the position of the mouse is relative to the element ?
Any ideas ?
public IWebElement CursorStyle => this.Driver.FindElement(By.Id("ui-id-3"));
public IWebElement DragObjectCursor => this.Driver.FindElement(By.Id("drag"));
public void DragWithCursor()
{
Actions action = new Actions(this.Driver);
action.MoveToElement(this.DragObjectCursor)
.ClickAndHold()
.MoveByOffset(50, 50)
.Perform();
}
public void GoToUrl()
{
this.Driver.Url = "http://demoqa.com/draggable/";
}
[Test]
public void DragElementCursorStyle()
{
_dragPage.GoToUrl();
_dragPage.CursorStyle.Click();
Thread.Sleep(2000);
_dragPage.DragWithCursor();
Thread.Sleep(3000);
}
Aucun commentaire:
Enregistrer un commentaire