断言有关拖放的错误

时间:2018-07-17 07:59:12

标签: c# selenium automation assert

当我尝试声明拖放结果(偏移x和y)时,我看到以下错误消息:

我的代码:

var sourceStartLocation = sourceStart.Location;
IWebElement target = driver.FindElement(By.Id("droppablerevert"));
Actions builder = new Actions(driver);
string classBefore = target.GetAttribute("class");

builder.DragAndDrop(sourceStart, target).Perform();

IWebElement fullTarget = driver.FindElement(By.Id("droppablerevert"));
string classAfter = fullTarget.GetAttribute("class");

driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);

IWebElement sourceEnd = driver.FindElement(By.Id("draggablerevert"));
var sourceEndLocation = sourceEnd.Location;

Assert.AreNotEqual(classBefore, classAfter);        
Assert.AreEqual(sourceStartLocation, sourceEndLocation);

0 个答案:

没有答案