我已经尝试了这两个代码,它被执行了,但是动作没有被执行,谁能告诉我为什么?
//Type one approach
Actions action = new Actions(Browser.Driver);
IWebElement sourceElement = Browser.Driver.FindElement(By.XPath(Filexpath));
IWebElement targetElement = Browser.Driver.FindElement(By.XPath(NewXpath));
//Type two approach
Actions Sourcebuilder = new Actions(Browser.Driver);
Actions SourceAction = Sourcebuilder.ClickAndHold(sourceElement);
Sourcebuilder.Build();
SourceAction.Perform();
/// move and drop
Actions builder = new Actions(Browser.Driver);
Actions action = builder.MoveToElement(targetElement);
builder.Release(targetElement);
builder.Build();
action.Perform();
提前致谢