I am having intermittent issues when doing drag & drop operations with ChromeDriver. Here is an excerpt from the code that causes the problem: WebElement resizeHandle = wd.findElement(By.xpath("//section[@id='fullscreenView']//div[contains(@class,'resizeHandle')]")); Actions builder = new Actions(wd); Action dragAllTheWayUp = builder.dragAndDropBy(resizeHandle, 0, -200).build(); dragAllTheWayUp.perform(); Unfotunately I can not provide a real test case as the tested web application is not publicly available. The idea of the code is to drag a div (which works as a resize handle in the application) up in the browser. This works perfectly with IE and with Firefox, but in Chrome around 1 of 4 times the div seems to be dragged down (i.e. as if positive offset was given in the dragAndDropBy() method)
hello, dragAndDropTo() doesn't work for me in the chrome driver very well. if it tries to drag to somewhere outside of the current viewing window it gives me funny results, like dragging in an incorrect direction. if you can't fix it you might try building the steps of the drag and drop yourself like such Action dragAllTheWayUp = builder.MoveToElement(resizeHandle) .ClickAndHold() .MoveByOffset(x, y) .Release() .Build(); dragAllTheWayUp.perform();
在使用ChromeDriver进行拖放操作时遇到间歇性问题,代码尝试在浏览器中将div上拉,但在Chrome浏览器中约四分之一的时间内,div似乎被向下拖动。拖放到浏览器窗口外时,结果不正确。可能需要自行构建拖放步骤来解决此问题。
874

被折叠的 条评论
为什么被折叠?



