export to Ruby not correct


#1

When I export a Katalon Recorder script to Ruby (WebDriver + RSpec), a couple of generated methods use “${receiver}”. With this, the script does not run with rspec, I have to change it to “@driver”.

Example:

def alert_present?()

${receiver}.switch_to.alert

true

rescue Selenium::WebDriver::Error::NoAlertPresentError

false

end

must be changed to:

def element_present?(how, what)

@driver.find_element(how, what)

true

rescue Selenium::WebDriver::Error::NoSuchElementError

false

end


#2

yes. It is not correct. what’s the code, we can help fix that!


#3

This is the code, generated from Katalon Recorder 3.7.0 (Chrome extension)

katalon_recorder_test.zip (2.6 KB)