[wtr-general] Re: How to get the Scite editor's error message in anotepad?

2009-08-03 Thread Chethan

You can capture the error in begin rescue loop so no need to worry
whether its get populated or not
You can do like this below
begin

rescue =e
  @msg=ErrorMessage(e)
end

for writing to a file
f = File.new(c:\log.txt,w)
@msg.each do |content|
  f.write(content)
 end
f.close()

I think this will solve the problem

Thanks,
Chethan


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How to get the Scite editor's error message in anotepad?

2009-08-02 Thread Rohan Ojha
Hi,

 

You can use the inbuilt logger method if you want to dump your error
messages in a notepad.

 


 

require 'watir'

require 'logger'

ie = Watir::IE.new

ie.goto('www.google.com')

log=Logger.new('c:/errorlog.txt')

if ie.text_field(:name,'q1').exists? then

 ie.text_field(:name,'q1').set('Log')

else

 log.error 'Text field with name q1 not found'

end

 

Hope this helps.

 

Thanks,

Rohan Ojha

 

-Original Message-
From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com]
On Behalf Of Prince3105
Sent: Saturday, August 01, 2009 11:16 AM
To: Watir General
Subject: [wtr-general] How to get the Scite editor's error message in
anotepad?

 

 

Hi i am a newbie to Watir,

 

Just i want to collect the log messages from the Scite editor and save

in a notepad.

 

If any methods are available to do that please post.

 

 

Thanks,

Prince3105



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---