Getting the stack trace


#1

Hi all,
I am using the following code to print the exception, but is there a
way to get the stack trace of the complete error like

Exception: No option with text of Contract form in this select element
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:3656:in
select_item_in_select_list' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:3621:inselect’
C:/InstantRails/ruby/lib/ruby/1.8/test/unit/testcase.rb:70:in run' C:/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:inrun’
C:/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in run' C:/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:inrun’
C:/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in run' C:/InstantRails/ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:44:inrun_suite’
C:/Backup/RadRails/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:107:in
start_mediator' C:/Backup/RadRails/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:52:instart’
C:/Backup/RadRails/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:272

begin


rescue Exception => e
puts e.to_s
end

so for my above code my output is “No option with text of Contract form
in this select element”
but i want the whole error trace, So how i could use the code in ruby
for this??


#2

Naga harish Kanegolla wrote:

C:/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:in `run’

so for my above code my output is “No option with text of Contract form
in this select element”
but i want the whole error trace, So how i could use the code in ruby
for this??

rescue Exception => e
puts e.to_s
puts e.backtrace.join("\n")
end


Michael W.