无法使用 Selenium 2.0 webdriver 和 Ruby 获取输入标签值。
@driver.find_element(:id, "customer_info_last_name").text
什么都不返回
和
@driver.find_element(:id, "customer_info_last_name").value
产生未知方法错误
检索输入标签值的正确方法是什么?
最佳答案
这个怎么样?
@driver.find_element(:id, "customer_info_last_name").attribute('value')
关于Ruby Selenium 2.0 无法获取输入标签的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9474036/