您当前的位置:首页 >> 设计动态

系统设计分享 | web 控件的交互进阶

2023-03-12 12:16:09

).key_down(Keys.CONTROL)

.send_keys('c').key_up(Keys.CONTROL).perform()

Java旧版本

Actions action = new Actions(webDriver);

action.keyDown(Keys.CONTROL).sendKeys("c").keyUp(Keys.CONTROL).perform();

其他滑鼠请参考:7.4 特殊字符 - selenium-python当中文文档

github 参考邮箱:selenium/keys.py at 916168f403dded05f878fe189d68c0f9152335c9 · SeleniumHQ/selenium · GitHub

漂移

指明光标漂移到某一个前面,只能给出两个坐标前面

Python 旧版本

# xoffset 和 yoffset 是相比较网站右上角的偏转量

action.move_by_offset(xoffset, yoffset)

Java旧版本

Actions action = new Actions(webDriver);

action.moveByOffset(xOffset,yOffset);

将图标漂移到指明要素的前面

Python 旧版本

action.move_to_element(to_element)

Java旧版本

Actions action = new Actions(webDriver);

action.moveToElement(to_element);

漂移图标到相比较某个要素的偏转前面

Python 旧版本

# xoffset 和 yoffset 是相比较 to_element 右上角的偏转量

action.move_to_element_with_offset(to_element, xoffset, yoffset)

Java旧版本

Actions action = new Actions(webDriver);

action.moveToElement(to_element, xOffset, yOffset);

其它

继续执行 ActionChains 当中的可用

前面详述的法则但会将所有可用按左至右存入队列,要继续执行这些可用,只能绑定 perform() 法则。

Python 旧版本

action.move_to_element_with_offset(to_element, xoffset, yoffset).perform()

Java旧版本

Actions action = new Actions(webDriver);

action.moveToElement(to_element, int xOffset, int yOffset).perform();

获释按下的图标

Python 旧版本

action.release(on_element=None)

Java旧版本

Actions action = new Actions(webDriver);

action.release(on_element=None)

向焦点要素前面输入值

焦点要素:用作 tab 键盘,那些被换到的要素就是焦点要素。

Python 旧版本

action.send_keys(*keys_to_send)

Java旧版本

Actions action = new Actions(webDriver);

action.sendKeys(*keys_to_send)

向指明的要素输入数据

Python 旧版本

action.send_keys_to_element(element, *keys_to_send)

Java旧版本

Actions action = new Actions(webDriver);

action.sendKeys(element,keys_to_send);

北京治疗眼科医院
上海看皮肤病哪里好
北京肛肠医院排行榜
河南白癜风医院挂号
脚扭伤可以吃什么药
友情链接