[wtr-general] Re: Log file for test results

2017-11-06 Thread Chuck van der Linden
On Saturday, November 4, 2017 at 11:16:43 AM UTC-7, Aqua wrote:
>
> Hi All,
>
> I am new to Watir and Ruby. I am trying to create a Log file to capture 
> log messages to 
> 1. validate successful google search and 
> 2. unsuccessful google search attempt
>
> I am using Eclipse IDE for executing the ruby scripts. Here is the code 
> that I am trying 
>
> require 'watir'
> require 'logger'
>   
>   $log = Logger.new('log.txt')  
>   $browser = Watir::Browser.new :chrome
>   $browser.goto('http://www.google.com')
>   $browser.text_field(:name,'q').set 'Quality Assurance'
>   $browser.button(:name,'btnK').click 
>
>   begin
> assert($browser.pageContainsText("Quality Assurance"))
>   $log.info("Given search text showed up!")
> rescue
> $log.error("Given search text did not show up!")   
>   end
>
> The code was running fine before I added the begin and end blocks. 
> (Also is the log file generated in the Ruby folder by default?)
> Could someone help me out  with this?
> Thanks in advance.
>   
>
> On Tuesday, March 4, 2008 at 10:07:36 PM UTC-8, Prasad wrote:
>>
>> Hi All, 
>>
>>
Please do not play necromancer and raise 9 year old threads from the dead.

The 'logger' gem (from what I can see) appears not to have had any commits 
for a very long time, and is likely not being maintained.   I would 
consider looking at a logging gem that shows signs of more current 
maintenance (and thus by implication, support)The two most likely 
suspects I see are:
  Logging 
  Timber  

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Log file for test results

2017-11-04 Thread Aqua
Hi All,

I am new to Watir and Ruby. I am trying to create a Log file to capture log 
messages to 
1. validate successful google search and 
2. unsuccessful google search attempt

I am using Eclipse IDE for executing the ruby scripts. Here is the code 
that I am trying 

require 'watir'
require 'logger'
  
  $log = Logger.new('log.txt')  
  $browser = Watir::Browser.new :chrome
  $browser.goto('http://www.google.com')
  $browser.text_field(:name,'q').set 'Quality Assurance'
  $browser.button(:name,'btnK').click 

  begin
assert($browser.pageContainsText("Quality Assurance"))
  $log.info("Given search text showed up!")
rescue
$log.error("Given search text did not show up!")   
  end

The code was running fine before I added the begin and end blocks. 
(Also is the log file generated in the Ruby folder by default?)
Could someone help me out  with this?
Thanks in advance.
  

On Tuesday, March 4, 2008 at 10:07:36 PM UTC-8, Prasad wrote:
>
> Hi All, 
>
>   Is it possble to generat log files Using Watir. I am using 
> Ruby+ Watir for my Testing. Test results and exceptions are appearing 
> in command line. Instead of that, is possible to catch those test 
> results and exceptions in log files. 
>
> Thanks in advance and appreciate your help. 
>
> Regards, 
> Prasad

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.