拖放功能停止使用 Protractor.net c# 为我工作的可能原因是什么?
使用http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced来测试这个功能。但对我没有用。
这是我尝试的示例代码:
Wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//h3[.='Container (允许的效果:全部)']")));
var elem = NgDriver.FindElement(By.XPath("//h3[.='Container (effects allowed: all)']"));
IWebElement parentElement = elem.FindElement(By.XPath(".."));
IWebElement mov = parentElement.FindElement(NgBy.Repeater("item in container.items"));
Wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//h3[.='Container (effects allowed: move)']")));
var drropElem = NgDriver.FindElement(By.XPath("//h3[.='Container (effects allowed: move)']"));
IWebElement parentElement2 = drropElem.FindElement(By.XPath(".."));
IWebElement mov2 = parentElement2.FindElement(NgBy.Repeater("item in container.items"));
Actions builder = new Actions(Driver);
Actions action = builder.ClickAndHold(mov);
builder.Build();
action.Perform();
builder = new Actions(Driver);
action = builder.MoveToElement(mov2);
builder.Release(mov2);
builder.Build();
action.Perform();
还尝试了 Action 中的 DragAndDrop() 函数。
任何帮助将不胜感激。