[ 
http://jira.openqa.org/browse/WTR-263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Charley Baker closed WTR-263.
-----------------------------

    Resolution: Cannot Reproduce

I'm closing this one, the code has changed a lot and no longer seeing this. 

> Loading Firefox takes 2 seconds. This time can be reduced by removing sleep. 
> [patch]
> ------------------------------------------------------------------------------------
>
>                 Key: WTR-263
>                 URL: http://jira.openqa.org/browse/WTR-263
>             Project: Watir
>          Issue Type: Improvement
>          Components: FireWatir
>    Affects Versions: 1.6.2
>         Environment: Winxp, Firefox 3, firewatir 1.2.1
>            Reporter: Tony
>             Fix For: Next
>
>
> When loading firefox, it waits for 2 seconds.
> This time can be reduced by removing the sleep in the initialize functions 
> and increasing the tries in set_defaults()
> The tries in the default, will keep trying to connect to the jssh telnet n 
> number of times.
> Hence this works out to be faster.
> code remains mostly the same .. just the last few lines of the initialize 
> function is changed.
> Below are the 2 lines
> #sleep waitTime  ## commented this line
> set_defaults(500)  #added 500 to the set_defaults.. it will try to connect 
> 500 times and then stop
> Code modified -
> module FireWatir
> class Firefox
> def initialize(options = {})
>                       if(options.kind_of?(Integer))
>                 options = {:waitTime => options}
>             end
>             if(options[:profile])
>                 profile_opt = "-P #{options[:profile]}"
>             else
>                 profile_opt = ""
>             end
>             puts "PROFILE: #{profile_opt}"
>             waitTime = options[:waitTime] || 2
>             if(RUBY_PLATFORM =~ /.*mswin.*/)
>                 #puts "plaftorm is windows"
>                 # Get the path to Firefox.exe using Registry.
>                 require 'win32/registry.rb'
>                 path_to_exe = ""
>                 
> Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Mozilla\Mozilla Firefox') 
> do |reg|
>                     keys = reg.keys
>                     reg1 = 
> Win32::Registry::HKEY_LOCAL_MACHINE.open("SOFTWARE\\Mozilla\\Mozilla 
> Firefox\\#{keys[0]}\\Main")
>                     reg1.each do |subkey, type, data|
>                         if(subkey =~ /pathtoexe/i)
>                             path_to_exe = data
>                         end
>                     end
>                 end
>                 puts "Starting Firefox using the executable : #{path_to_exe}"
>                 puts "Waiting for #{waitTime} seconds for Firefox to get 
> started."
>                 @t = Thread.new { system("\"#{path_to_exe}\" -jssh 
> #{profile_opt}") }
>             elsif(RUBY_PLATFORM =~ /linux/i)
>                 puts RUBY_PLATFORM
>                 path_to_bin = `which firefox`.strip
>                 puts "#{path_to_bin} -jssh #{profile_opt}"
>                 @t = Thread.new { `#{path_to_bin} -jssh #{profile_opt}` }
>             end     
>             
>             #sleep waitTime  ## commented this line
>             
>             set_defaults(500)  #added 500 to the set_defaults.. it will try 
> to connect 500 times and then stop
>             get_window_number()
>             set_browser_document()
>         end

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.openqa.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to