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

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

问题描述

我要制作硒脚本,该脚本可以移动以下站点上给出的滑块

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

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

Example name is How to change orientation of jQuery UI Slider

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

我不知道该怎么做

推荐答案

生成操作链

动作链生成器实现了Builder模式,以创建包含一组其他动作的CompositeAction.这应该通过配置一个Actions链生成器实例并调用它的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天全站免登陆