jaswant gupta
jaswant gupta

Reputation: 11

ruby selenium element.click has different output with different environment

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"    
[email protected]_element(:xpath,"//span[contains(text(),'Remove Frame')]").click    
p el

Output with following Setup

2.6.0 :006 > @driver.find_element(:xpath,"//span[contains(text(),'Remove Frame')]").click => nil

Environment

  1. Mozilla Firefox 60.5.0
  2. ruby 2.6.0p0 (2018-12-25 revision 66547)[x86_64-linux]
  3. selenium-webdriver-3.141.0

    Output with the following Setup

2.1.2 :006 > @driver.find_element(:xpath,"//span[contains(text(),'Remove Frame')]").click => "ok"

Environment

  1. Mozilla Firefox 52.2.0
  2. ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
  3. selenium-webdriver-2.53.4

Upvotes: 0

Views: 67

Answers (1)

Guy
Guy

Reputation: 50864

click method doesn't return an explicit value, so it returns nil by Ruby default.

Upvotes: 0

Related Questions