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();
分享到:
相关推荐
揭秘WebDriver实现原理的实现原理
webdriver API中文版 webdriver API中文版 2 1.1 下载selenium2.0的lib包 2 1.2 用webdriver打开一个浏览器 2 1.3 打开测试页面 3 1.4 GettingStarted 3 第2章 Webdirver对浏览器的支持 5 2.1 HtmlUnit Driver...
用webdriver调用浏览器时,有时浏览器窗口不是总是最大化的状态,可以封装一个函数实现浏览器窗口的最大化。 下面给出一个具体实例: public class IeDriver { public static void main(String[] args) { ...
它是 WebDriver 协议的实现之一,提供了与 Chrome 浏览器进行交互的接口,使得开发人员可以通过编程方式控制浏览器的行为。 基本介绍: 1、自动化测试:ChromeDriver 常用于自动化测试场景中,开发人员可以使用 ...
Selenium 2 WebDriver 初级视频教程(三) 介绍webdriver 框架中的两个重要接口, WebDriver和WebElement, 其操作是使用WebDriver框架实现自动化测试的基础
IE Webdriver Python
webdriver安装包
WebDriver实验版VB6版WebDriver实验,压缩包中有技术文档《WebDriver原理及实验》
• 在命令行中输入gem list,如果selenium-webdriver正确安装,则其应该出现在结果列表里。在文本写作时,selenium webdriver的最新版本应该是2.2.0; gem list selenium-webdriver 安装firefox。本文使用firefox作为...
php-webdriver-examples php-webdriver 的示例实现。 此项目的有用链接 页面对象模式: : Selenium: :
webdriver-helper安装包,whl版本
使用webdriver实现主页面跳转到子页面后又回到主页面的操作
php-webdriver-bindings这个PHP库允许创建功能测试与PHP webdriver
Selenium WebDriver Practical Guide will guide you through the various APIs of WebDriver which should be used in automation tests, followed by a discussion of the various WebDriver implementations ...
本书是一本从入门到精通模式的Selenium WebDriver实战经验分享书籍。全书共分为四个部分:第1部分基础篇主要讲解自动化测试相关的基础理论、WebDriver 环境安装、单元测试工具的使用方法以及 WebDrvier的入门使用...
用于绕过webdriver检测的js,结合文章Selenium注入便能实现
Selenium WebDriver详解及事例
webdriver 数据驱动 webdriver 数据驱动webdriver 数据驱动webdriver 数据驱动webdriver 数据驱动webdriver 数据驱动
WebDriver命令参考手册
调用webdriver打开网页