[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.


[wtr-general] No Assertion and testcase in watir-classic 3.1.0

2012-08-28 Thread AQUA
Hello All, just today I updated to watir to watir 3.0.0 from watir 2. I had 
been using using watir 3.0.0 on a separate system for quite a time being. 
But after the update today I found watir-classic is updated to 3.1.0 from 
3.0.0. But thew issue is it doesn't have assertion.rb and testcase.rb fle. 
Whin I checked the change logs in GitHub, it mentions that Watir::Assertion 
 is moved to assertion.rb file.

Can any one assist what is the issue.

-- 
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


[wtr-general] Re: Handling Java script Popup with Ruby in WATIR

2012-06-01 Thread AQUA
Hi  Linden,
I tried out the example from watir -webdriver but I m still getting the 
following error message:

C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/response.rb:52:in
 
`assert_ok': Modal dialog present 
(Selenium::WebDriver::Error::UnhandledAlertError)
while following line is  executed

*$browser.alert.exists?*

On Friday, April 27, 2012 12:12:46 PM UTC+5:30, AQUA wrote:

 Hi All,

 I have been working on WATIR for sometimes, but finding issues in handling 
 Java Script pop-ups.

 on the screen i m testing there is a on_click event. I tried AutoIt and 
 some other examples avaliable on WATIR wiki at 
 http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups

 Most of the examples work with click_no_wait statment. But when I use 
 fire_event('onclick') the popup is generated the the execution halts till I 
 manually click the pop-up button. This doesn't happens with click_no_wait.

 Can any one assist me on how can I work out a solution with fire_event as 
 I also need to fire events like onblur, onhover, etc.


 Thanks and  Regards,
 Manav Gupta
 Bangalore.


On Friday, April 27, 2012 12:12:46 PM UTC+5:30, AQUA wrote:

 Hi All,

 I have been working on WATIR for sometimes, but finding issues in handling 
 Java Script pop-ups.

 on the screen i m testing there is a on_click event. I tried AutoIt and 
 some other examples avaliable on WATIR wiki at 
 http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups

 Most of the examples work with click_no_wait statment. But when I use 
 fire_event('onclick') the popup is generated the the execution halts till I 
 manually click the pop-up button. This doesn't happens with click_no_wait.

 Can any one assist me on how can I work out a solution with fire_event as 
 I also need to fire events like onblur, onhover, etc.


 Thanks and  Regards,
 Manav Gupta
 Bangalore.


-- 
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


[wtr-general] Re: Handling Java script Popup with Ruby in WATIR

2012-05-01 Thread AQUA
Hello Bhavesh,
thanks for your reply. I have been using AutoIt only to handle the pop-ups. 
I guess I have not been able to make myself clear.
Actually the issue I m facing is I have to javascript events, on oncClick 
and other onBlur. For onClick I m using click_no_wait which works fine, i.e 
the AutoIt component clicks the ok button in case there is  a pop-up.

However, for onBlur event i m using fire_event('onBlur') available with 
WATIR for firing the java script. The issue I m facing is when I use 
fire_event, once the java script generates the pop-up, the execution gets 
stuck untill I manually click the ok button, unlike as incase of 
click_no_wait where once the pop-up is generated the execution flows to the 
next statement that Handles the pop-up using AutoIt.

Please assist.

Thanks and Regards,

Manav Gupta

On Wednesday, May 2, 2012 1:58:08 AM UTC+5:30, Bhavesh wrote:

 If you have autoit installed, then you can create a small script which 
 look for the window title and the button. 

 As soon as that titles window is there, it will clck the button. 

 Sample may be like : 

  

 require 'win32ole' 

 begin 
   autoit = WIN32OLE.new('AutoItX3.Control') 

  loop do 
sleep(30) 
autoit.ControlClick(Microsoft Office Outlook,'', 'OK') 
autoit.ControlClick(Security Information,'', 'Yes') 
autoit.ControlClick(Security Alert,'', 'Yes') 
sleep(20) 

   end 
   Send({SPACE}) 

   rescue Exception = e 
 puts e 
   end 

  

 Have this script runing when you run your script. 

 Bhavesh 

 On Apr 30, 10:13 am, Chuck van der Linden sqa...@gmail.com wrote: 
  consider moving to watir-webdriver perhaps? 
  
  
  
  
  
  
  
  On Sunday, April 29, 2012 10:19:33 PM UTC-7, AQUA wrote: 
  
   No I have been using, WATIR. And the issue I m facing is; basically I 
 have 
   been able to handle the popup using some of the examples available on 
 WATIR 
   wiki. But only with click_no_wait. Whenever I use fire_event the the 
   javascript is executed but the execution flow stuck until I manually 
 click 
   the ok button. Hence the flow never enters the section of the code 
 that is 
   used for handling pop-up without manual interference. 
  
   Thanks  Regards, 
   Manav 
  
   On Friday, April 27, 2012 1:37:34 PM UTC+5:30, Željko Filipin wrote: 
  
   On Fri, Apr 27, 2012 at 8:42 AM, AQUA manavkbgu...@gmail.com 
 wrote: 
I have been working on WATIR for sometimes, but finding issues in 
   handling Java Script pop-ups. 
  
   If you are using watir-webdriver, this could help: 
  
  http://watirwebdriver.com/javascript-dialogs/ 
  
   Željko 
   -- 
   watir.com/book - author

-- 
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


Re: [wtr-general] Handling Java script Popup with Ruby in WATIR

2012-04-29 Thread AQUA
No I have been using, WATIR. And the issue I m facing is; basically I have 
been able to handle the popup using some of the examples available on WATIR 
wiki. But only with click_no_wait. Whenever I use fire_event the the 
javascript is executed but the execution flow stuck until I manually click 
the ok button. Hence the flow never enters the section of the code that is 
used for handling pop-up without manual interference.

Thanks  Regards,
Manav

On Friday, April 27, 2012 1:37:34 PM UTC+5:30, Željko Filipin wrote:

 On Fri, Apr 27, 2012 at 8:42 AM, AQUA manavkbgu...@gmail.com wrote:
  I have been working on WATIR for sometimes, but finding issues in 
 handling Java Script pop-ups.

 If you are using watir-webdriver, this could help:

 http://watirwebdriver.com/javascript-dialogs/

 Željko
 --
 watir.com/book - author
  

-- 
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


[wtr-general] Handling Java script Popup with Ruby in WATIR

2012-04-27 Thread AQUA
Hi All,

I have been working on WATIR for sometimes, but finding issues in handling 
Java Script pop-ups.

on the screen i m testing there is a on_click event. I tried AutoIt and 
some other examples avaliable on WATIR wiki at 
http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups

Most of the examples work with click_no_wait statment. But when I use 
fire_event('onclick') the popup is generated the the execution halts till I 
manually click the pop-up button. This doesn't happens with click_no_wait.

Can any one assist me on how can I work out a solution with fire_event as I 
also need to fire events like onblur, onhover, etc.


Thanks and  Regards,
Manav Gupta
Bangalore.

-- 
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


[wtr-general] watir/testcase in WATIR 3

2012-04-25 Thread AQUA
Hi All,

I have been working on WATIR 2.0.4 since last 6 months and now as
WATIR is updated to 3, I cant find watir/testcase in the commonwatir
folder. Seems as if watir/testcase has not been included in the latest
WATIR version. Can any one help me out of this.
And is their any way to by which I can use my existing gem libraries,
into some other system instead of installing it from them using gem
install



Thanks  Regards,

Manav Gupta
Bangalore

-- 
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


[wtr-general] WATIR Testing - Setup and colse method

2012-03-18 Thread AQUA
Hi All,

I have been working on a web application test automation project. As per 
the project requirement I need a method to be executed before beginning of 
my set test-case methods and another method to be executed at the end of 
all the test-case method. You can consider those to methods to be as setup 
and teardown. Where in the setup method I will create instance of my 
browser and go to the link of the application to be tested. And in the 
teardiwn method , after execution of all my test cases I will simply close 
any file if opened and close the instance of the browser. 
I read about add_setup_hook and add_teardown_hook of MiniTest class but the 
first thing is that I m using Watir::TestCase class and the other issue is 
I couldn't understand how to use those two methods even with MiniTest.

Please provide me with some valuable references and ideas to achieve the 
design.

Thanks  Regards

*Manav Kumar Gupta*
Bengaluru.

-- 
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


[wtr-general] POPUP HANDLING IN WATIR

2012-01-30 Thread AQUA
Hi All, I have been using this above module to handle popup in my WATIR 
tests. what I have seen is it works fine when I call a click_no_wait on my 
submit button. When I try to use fire_event method it doesn't works as 
expected and the execution halts till i manually click the OK button. 
Please help
I am adding a section of the code I m using below

:Doesn't work untill I click the OK button on the dialog box manually
---
$browser.text_field(:id, 'MIR-DV-EFF-DT').set('13-10-2011')
#$browser.text_field(:id, 'MIR-DV-EFF-DT').fire_event(onBlur)
popupMsg = clickprompt(OK,,$browser) 
puts popupMsg

:Works fine and give me a console output Invalid Date format '13-10-2011' 
---
$browser.text_field(:id, 'MIR-DV-EFF-DT').set('13-10-2011') 
$browser.button(:id, 'OKButton').click_no_wait
popupMsg = clickprompt(OK,,$browser)  
puts popupMsg

-- 
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


HandlePopUp.rb
Description: Binary data