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 =>无
环境
selenium-webdriver-3.141.0
使用以下设置输出
2.1.2:006> @ driver.find_element(:xpath,“ // span [contains(text(),'Remove Frame')]”)。click =>“好”
环境