Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Ross W
RE: Rasta breaks Watir's modal_dialog method? [ reply ]  
2010-03-29 22:12
Ok - think I found a fix. Evidently Rasta's use of win32ole for working with spreadsheets is conflicting with Watir's modified version of win32ole. In ...\lib\rasta\spreadsheet.rb, in the Book class, I replaced "require 'win32ole'" with "require 'watir/win32ole'" (line 156 in rasta 0.1.10), and voila, the above example runs fine. Hope someone finds this helpful...Cheers!

By: Ross W
Rasta breaks Watir's modal_dialog method? [ reply ]  
2010-03-29 15:51
I'm finding that I can run Watir scripts that use the modal_dialog method fine by themselves, but running the same script from Rasta gives me:

NoMethodError: IE#modal_dialog not supported with the current version of Ruby (1.8.6).
See http://jira.openqa.org/browse/WTR-2 for details.
undefined method `connect_unknown' for WIN32OLE:Class

For example, the following works perfectly for me:

require 'watir'
@browser = Watir::Browser.new
@browser.goto "http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/showModalDialog2.htm";
@browser.select_list(:name, "oHeight").select "300"
@browser.button(:value, "Push To Create").click_no_wait
sleep 3
@browser.modal_dialog.close

But the following fails with the NoMethodError:

require 'watir'
require 'rasta/fixture/rasta_fixture'
class ModalDialog
include Rasta::Fixture::RastaFixture
attr_accessor :height

def test?
@browser = Watir::Browser.new
@browser.goto "http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/showModalDialog2.htm";
@browser.select_list(:name, "oHeight").select @height
@browser.button(:value, "Push To Create").click_no_wait
sleep 3
@browser.modal_dialog.close
return 0
end

end

If I leave out calls to modal_dialog, everything works great. Feel like I'm missing something obvious...any suggestions would be greatly appreciated. Thanks!