Aqua
2017-11-04 09:21:41 UTC
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.
--
Before posting, please read http://watir.com/support. In short: search before you ask, be nice.
watir-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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.
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
--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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.