Before do | scenario | # need to configure env variables for browser caps = { caps: { browserName: "#{ENV['browserName']}", platformVersion: "#{ENV['platformVersion']}", deviceName: "#{ENV['deviceName']}", platformName: "#{ENV['platformName']}", fullReset: false, noReset: true, dontStopAppOnReset: true, app: "#{ENV['app']}" }, appium_lib: { server_url: "http://#{ENV['server_url']}/wd/hub" } } @driver = Appium::Driver.new(caps,true) @driver.start_driver end After do | scenario | sessionid = @driver.session_id jobname = "#{scenario.feature.name} - #{scenario.name}" puts "SessionID=#{sessionid} job-name=#{jobname}" @driver.driver_quit # # if scenario.passed? # SauceWhisk::Jobs.pass_job sessionid # else # SauceWhisk::Jobs.fail_job sessionid # end end