红宝石硒元素。点击在不同环境下具有不同的输出

时间:2019-02-20 09:03:24

标签: ruby selenium selenium-webdriver

require 'selenium-webdriver'    
caps = Selenium::WebDriver::Remote::Capabilities.firefox    
caps['acceptInsecureCerts'] = true    
@driver = Selenium::WebDriver.for(:firefox, desired_capabilities: caps)    
@driver.navigate.to "https://s1.demo.opensourcecms.com/s/44"    
el=@driver.find_element(:xpath,"//span[contains(text(),'Remove Frame')]").click    
p el

使用以下设置输出

  

2.6.0:006> @ driver.find_element(:xpath,“ // span [contains(text(),'Remove Frame')]”)。click    =>无

环境

  1. Mozilla Firefox 60.5.0
  2. 红宝石2.6.0p0(2018-12-25修订版66547)[x86_64-linux]
  3. selenium-webdriver-3.141.0

    使用以下设置输出

  

2.1.2:006> @ driver.find_element(:xpath,“ // span [contains(text(),'Remove Frame')]”)。click    =>“好”

环境

  1. Mozilla Firefox 52.2.0
  2. 红宝石2.1.2p95(2014-05-08修订版45877)[x86_64-linux]
  3. selenium-webdriver-2.53.4

1 个答案:

答案 0 :(得分:0)

click method不返回显式值,因此默认情况下它返回nil