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