Sha256: 71b9595a1a3df5b01b009397f26377fdabda513206c70db8485a5e2e6191ed8b
Contents?: true
Size: 1.63 KB
Versions: 24
Compression:
Stored size: 1.63 KB
Contents
module Scoutui::Commands class UpdateUrl < Command def execute(drv, _e=nil) @drv=drv if !drv.nil? _req = Scoutui::Utils::TestUtils.instance.getReq() baseUrl = Scoutui::Base::UserVars.instance.getHost() url = @cmd.match(/navigate\s*\((.*)\)/i)[1].to_s.strip Scoutui::Logger::LogMgr.instance.commands.debug __FILE__ + (__LINE__).to_s + " url => #{url}" if Scoutui::Utils::TestUtils.instance.isDebug? _relativeUrl = url.strip.start_with?('/') if _relativeUrl Scoutui::Logger::LogMgr.instance.commands.debug __FILE__ + (__LINE__).to_s + " [relative url]: #{baseUrl} with #{url}" if Scoutui::Utils::TestUtils.instance.isDebug? url = baseUrl + url end url = Scoutui::Base::UserVars.instance.get(url) Scoutui::Logger::LogMgr.instance.commands.debug __FILE__ + (__LINE__).to_s + " | translate : #{url}" if Scoutui::Utils::TestUtils.instance.isDebug? _rc=false begin Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " navigate.to(#{url})" _start=Time.now @drv.navigate.to(url) _stop=Time.now _duration=_stop - _start puts __FILE__ + (__LINE__).to_s + " Perf navigate to #{url} : #{_duration}" Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " => title #{@drv.title.to_s}" _rc=true rescue => ex Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Error during processing: #{ex.message}" Scoutui::Logger::LogMgr.instance.warn "Backtrace:\n\t#{ex.backtrace.join("\n\t")}" end setResult(_rc) end end end
Version data entries
24 entries across 24 versions & 1 rubygems