[ http://jira.openqa.org/browse/WTR-481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20182#action_20182 ]
Ethan commented on WTR-481: --------------------------- this is a valid bug - I encountered this when testing ruby 1.9. WIN32OLE has changed and now raises NoMethodError in some cases where it used to raise WIN32OLERuntimeError, so Watir's code that currently expects WIN32OLERuntimeError (which gets raised from WIN32OLE fairly frequently) should be changed to also rescue from NoMethodError. > Not able to open new IE after it is closed. > ------------------------------------------- > > Key: WTR-481 > URL: http://jira.openqa.org/browse/WTR-481 > Project: Watir > Issue Type: Bug > Components: Unit Tests > Affects Versions: Soon > Environment: Windows XP running IE7 > Reporter: bhavesh > Priority: Critical > Fix For: Soon > > > Hi, > I have to close IE and open new IE again in every testcase. > I written an routine like this : > def setupnew(current_component="") > $ie.close if $ie > sleep(10) > $ie = Watir::IE.new() > sleep(10) > case current_component > when "WEB_ADMIN" > $ie.goto($adminLink) > when "WEB_REPORT" > $ie.goto($reportLink) > when "WEB_SEARCH" > $ie.goto($searchLink) > else > #puts "Setup case does not match" > end > end > This works well in Ruby 1.8 > Recently i upgrade to Ruby 1.9.2 and this routine start failing. > It closes the IE if it is open but then not opening the new IE it > just came out of script throwing error. > Error coming out as : > TestCaseNum: I18N_0001 > Description: Add AD Authentication from Webadmin, for FIGS. > E > Finished in 0.468750 seconds. > 1) Error: > test_0001(TC_I18N): > NoMethodError: unknown property or method: `name' > HRESULT error code:0x800706ba > The RPC server is unavailable. > C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.8.1/lib/watir/ie- > class.rb:319:in > `method_missing' > C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.8.1/lib/watir/ie- > class.rb:319:in > `exists?' > C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.8.1/lib/watir/ie- > class.rb:406:in > `close' > C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/KazModules/I18N/ > I18N_Regression.rb > :47:in `setupnew' > C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/KazModules/I18N/ > I18N_Regression.rb > :102:in `test_0001' > got the problem but not the solution. > In watir 1.6.7 which i use previously, code for ie.close is like > this : > #C:\ruby\lib\ruby\gems\1.8\gems\watir-1.6.7\lib\watir > # Closes the Browser > def close > return unless exists? > @closing = true > @ie.stop > wait rescue nil > chwnd = @ie.hwnd.to_i > @ie.quit > while Win32API.new("user32","IsWindow", 'L', 'L').Call(chwnd) == > 1 > sleep 0.3 > end > end > In watir 1.8.1 which i use now, code for ie.close is like this : > C:\Ruby192\lib\ruby\gems\1.9.1\gems\watir-1.8.1\lib\watir > # Closes the Browser > def close > return unless exists? > @ie.stop > wait rescue nil > chwnd = @ie.hwnd.to_i > @ie.quit > t = Time.now > while exists? > # just in case to avoid possible endless loop if failing to > close some > # window or tab > break if Time.now - t > 10 > sleep 0.3 > end > end > There is an change in code in 1.8.1. > If i replace the piece of code for ie.close of version 1.6.7 in 1.8.1 > file, the same routine starts working fine. > So what needs to be done now to have this working with 1.8.1 code? > Bhavesh -- 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 Wtr-development@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-development