2
我已经尝试了这两个代码,它得到执行,但行动没有得到执行,任何人都可以告诉我为什么?拖放得到执行,但它没有得到执行 - webdriver
//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();
在此先感谢
谢谢你最后一个解决了问题 – 2013-02-12 14:32:42