如何使用Selenium Ruby Webdriver双击表中的单元格 [英] how to double-click on a cell in table with Selenium Ruby Webdriver

查看:150
本文介绍了如何使用Selenium Ruby Webdriver双击表中的单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下代码双击Web应用程序中表格中的单元格(我试图两次单击以希望它们等于双击).但是,根本没有单击该单元格,但是我希望双击该单元格后,将显示文本字段供我编辑该单元格的信息.

I'm trying to use below codes to double-click on a cell in a table in my web application (I tried to do Click two times with the hope that they are equal to double-click). However, the cell is not clicked at all, but I expect that after double-clicking on the cell, the text field will be displayed for me to edit info of that cell.

@driver.find_element(:xpath => "//table[@id='gridabc']//tr[1]/td[9]").click
@driver.find_element(:xpath => "//table[@id='gridabc']//tr[1]/td[9]").click

我正在使用 Selenium Ruby Webdriver .请帮助指导我解决此问题的方法.非常感谢.

I'm using Selenium Ruby Webdriver. Please help guide me a way to resolve this. Thanks much.

推荐答案

#@example Double click an element

el = driver.find_element(:id, "some_id")
driver.action.double_click(el).perform

文档中无耻复制的代码:)

Code shamelessly copied from the documentation :)

这篇关于如何使用Selenium Ruby Webdriver双击表中的单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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