如何使用 Selenium Webdriver 移动 jQuery 的水平滑块或垂直滑块 [英] How to move Horizontal Slider or Vertical Slider of jQuery using Selenium Webdriver

查看:22
本文介绍了如何使用 Selenium Webdriver 移动 jQuery 的水平滑块或垂直滑块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作 selenium 脚本来移动以下网站上给出的滑块

I want to Make selenium script which move slider given on following site

示例名称是如何更改 jQuery UI 滑块的方向

Example name is How to change orientation of jQuery UI Slider

http://jqueryui.com/demos/slider/

我不知道该怎么做

推荐答案

生成动作链

Actions 链生成器实现了 Builder 模式来创建一个包含一组其他操作的 CompositeAction.这应该通过配置一个动作链生成器实例并调用它的 build() 方法来获取复杂的动作来简化构建动作:

The Actions chain generator implements the Builder pattern to create a CompositeAction containing a group of other actions. This should ease building actions by configuring an Actions chains generator instance and invoking it's build() method to get the complex action:

 Actions builder = new Actions(driver); 
 Action dragAndDrop = builder.clickAndHold(someElement)
    .moveToElement(otherElement)
    .release(otherElement)
    .build(); 
 dragAndDrop.perform();

这篇关于如何使用 Selenium Webdriver 移动 jQuery 的水平滑块或垂直滑块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆