[wtr-general] Re: Issues with execute_script on Win7/IE9

2013-06-06 Thread enroxorz
Is there any way to disable this? This is driving me up the wall since I am 
allowing active content from security...

On Wednesday, June 5, 2013 3:29:48 PM UTC-4, Andrew Leaf wrote:



 On Monday, June 3, 2013 9:28:50 AM UTC-5, enroxorz wrote:

 So I know that this issue was resolved here:

 https://groups.google.com/d/msg/watir-general/FqVBzjNuOqA/7HtFJoJYzzkJ

 but when I tested it I was running on Windows XP SP 3 with IE 8. We just 
 got new testing servers in that are Windows 2008 and IE9 and when I do the 
 following I get an error (attached is the test html file).

 b = Watir::Browser.new
 b.goto('file:///c:/test.html/')
 b.execute_script window.prompt = function() { return true; }

 Using Win7 and IE9, I noticed Internet Explorer restricted this webpage 
 from running scripts or ActiveX controls displayed on the bottom of my 
 browser when heading to test.html on my local machine.

 I had to click that before executing any javascript from that file.  

 Andre




-- 
-- 
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/groups/opt_out.




[wtr-general] Issues with execute_script on Win7/IE9

2013-06-03 Thread enroxorz
So I know that this issue was resolved here:

https://groups.google.com/d/msg/watir-general/FqVBzjNuOqA/7HtFJoJYzzkJ

but when I tested it I was running on Windows XP SP 3 with IE 8. We just 
got new testing servers in that are Windows 2008 and IE9 and when I do the 
following I get an error (attached is the test html file).

b = Watir::Browser.new
b.goto('file:///c:/test.html/')
b.execute_script window.prompt = function() { return true; }

WIN32OLERuntimeError: (in OLE method `execScript': )
OLE error code:80020101 in Unknown
  Could not complete the operation due to error 80020101.
HRESULT error code:0x80020009
  Exception occurred.
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-classic/page-container.rb:29:in
 
`method_missing'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-classic/page-container.rb:29:in
 
`rescue in execute_script'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-classic/page-container.rb:22:in
 
`execute_script'
from (irb):5
from C:/Ruby193/bin/irb:12:in `main'

I've also attached the settings. 

I know this is an annoying issue, and I am sorry for bring it up, but one 
of our legacy systems has an issue with dual JS popups that the devs cannot 
take out (for one reason or another).

Thank you very much for your help.

-- 
-- 
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/groups/opt_out.



  
  

  
attachment: settings.png

[wtr-general] Re: watir-classic issue with execute_script and JSON

2013-02-13 Thread enroxorz
Please make sure to post your findings. I've been monitoring this because I 
also have the same issue as you (didn't post because I didn't have anything 
new to add to this).

On Tuesday, February 12, 2013 5:51:37 PM UTC-5, captin wrote:

 The issue still exists when trying your suggestion. I will play around 
 with security settings and see if that leads to any resolution.
  
 Thanks!

 On Saturday, February 9, 2013 5:19:14 AM UTC-6, Jarmo Pertman wrote:

 To be honest - i'm not sure where's the problem since i cannot reproduce 
 it on my IE8. I have one idea - create a local html file with the contents:
 html
   head
 script type=text/javascript 
 src='file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js/script
   /head
   body
 foo
   /body
 /html

 Open that file with your internet explorer and try then the JavaScript 
 commands in the developer tools. If they still don't work then it has 
 probably something to do with your IE security settings.

 Jarmo Pertman
 -
 IT does really matter - http://itreallymatters.net


 On Friday, February 8, 2013 5:51:27 PM UTC+2, captin wrote:

 Same result. The script errors just continue to pile up.
  
 Do you think this is a bug? If so, is it a json2.js or a watir-classic 
 issue?
  
 Thanks.
  

 On Friday, February 8, 2013 1:39:14 AM UTC-6, Jarmo Pertman wrote:

 That's sad to hear. What if you run execute_script two times in a row - 
 will you also get an error for the second run?

 Jarmo Pertman
 -
 IT does really matter - http://itreallymatters.net

 On Thursday, February 7, 2013 12:58:36 AM UTC+2, captin wrote:

 Jarmo,
  
 My apologies for the versioning miscommunication. My initial post and 
 initial error messages are correct with Ruby 1.9.3 and Watir-Classic 
 3.4.0, 
 but the line 
 json2.src='file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js';
  
 is probably what threw you off. That was a copy/paste mistake. The line 
 that I truly used for troubleshooting was 
 json2.src='file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js';
  
 I hope this clears things up.
  
 I also tried copying the json2.js file you linked into my 
 watir-classic gem, and then I ran the same troubleshooting commands along 
 with the original watir command I am trying to use. Same results, even 
 though the two json2.js files are slightly different.
  
  

 On Wednesday, February 6, 2013 11:11:19 AM UTC-6, Jarmo Pertman wrote:

 Hi!

 I just noticed that you had Ruby 1.9.3 vs 1.9.2 and Watir-Classic 
 3.3.0 vs 3.4.0 in your error messages.
 Which one was it actually and why do they differ?

 Can you try to copy the watir-classic gem's json2.js file over with 
 the contents of 
 https://raw.github.com/douglascrockford/JSON-js/master/json2.js and 
 see if that makes any difference?

 Jarmo Pertman
 -
 IT does really matter - http://itreallymatters.net


 On Monday, February 4, 2013 4:53:52 PM UTC+2, captin wrote:

 Jarmo,
  
 There is no error when I copy the local json2.js file (located at 
 file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js)
  
 contents to the IE developer tools window. When I run the stringify 
 command 
 you gave me, the out put is {a:foo}. And I get the exact same 
 results when I use the other json2.js you linked and then run the 
 command 
 again.
 I also tried the original commands you gave previously (typeof JSON 
 and typeof JSON.stringify) after I loaded the json2.js script manually, 
 and 
 the outputs were object and function respectively.
  
 In your opinion, is there some sort of automatic loading or 
 accessing issue between JSON and IE?
  
 Thanks.
  
 On Saturday, February 2, 2013 9:47:53 AM UTC-6, Jarmo Pertman wrote:

 Can you try by copying all the contents of the json2.js file from 
 file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js
  to 
 your IE developer tools window? Do you get any errors when doing that 
 too? 
 What does this code return after doing that: JSON.stringify({a: foo})

 What about using the code at 
 https://raw.github.com/douglascrockford/JSON-js/master/json2.js ?

 Jarmo Pertman
 -
 IT does really matter - http://itreallymatters.net


 On Thursday, January 31, 2013 1:01:11 AM UTC+2, captin wrote:

 I have encountered an issue with execute_script using IE9 with 
 ruby 1.9.3p327 and watir-classic 3.4.0. I was doing some research and 
 found 
 my exact same issue detailed at Stack 
 Overflowhttp://stackoverflow.com/questions/14142905/issue-with-execute-script,
  
 but the thread is stale (and I'm too new to be able to comment on the 
 issue 
 there). Jarmo was assisting but the OP hasn't responded in over three 
 weeks.
  
 I hate redundancy but I also hate waiting indefinitely so I 
 figured I'd pose the question here. Using the following code:
  
 browser.execute_script window.confirm 

[wtr-general] Re: watir-classic issue with execute_script and JSON

2013-02-13 Thread enroxorz
I tested Jarmo's suggestion regarding changing security options (*Allow 
active content to run files on My Computer* and *Allow software to run or 
install even if the signature is invalid*) and it worked in my preliminary 
test. Attached is the HTML file, my screenshot from the IE settings, and I 
tested these settings with the script below (with results):

Windows XP Service Pack 3
IE 8

Script:

browser = Watir::Browser.new
browser.goto 'file:///c:/test.html'
browser.execute_script window.confirm = function() { return true; }
browser.execute_script window.alert = function() { return true; }
browser.execute_script window.prompt = function() { return true; }
browser.button(:value = 'Press').click

Results from IRB:

irb(main):001:0 browser = Watir::Browser.new
= #Watir::IE:0x..f2d5577a url=about:blank title=
irb(main):002:0 browser.goto 'file:///c:/test.html'
= 0.078111
irb(main):003:0 browser.execute_script window.confirm = function() { 
return true; }
= nil
irb(main):004:0 browser.execute_script window.alert = function() { return 
true; }
= nil
irb(main):005:0 browser.ecute_script window.prompt = function() { return 
true; }
= nil
irb(main):006:0 browser.button(:value = 'Press').click
= 0.015622
irb(main):007:0

Thank you very much, Jarmo! This issue has been bugging me since 
watir-classic 3.1.0. 

captin: Can you recreate my results successfully?

On Wednesday, February 13, 2013 3:40:20 PM UTC-5, captin wrote:

 The HTML code worked properly when I fixed the extra character issue you 
 highlighted. When I run the typeof JSON command it returns object and 
 when I run typeof JSON.stringify it returns function.
  
 My enterprise security settings don't allow me to change that setting so 
 I'm unable to prove out your theory. On my system, the setting appears to 
 be disabled by default, and when I open the HTML file from your previous 
 suggestion I get a message saying there's blocked content, but I'm able to 
 click a button to allow it. I am able to modify my registry, so if I can 
 locate that setting in the registry I might be able to test out your theory.
  
 In the meantime, maybe enroxorz is able to proove it out.
  
 Thanks.
  

 On Wednesday, February 13, 2013 2:28:56 PM UTC-6, Jarmo Pertman wrote:

 I think that i can reproduce the problem with tweaking a setting in IE.

 There is a setting under Internet Options - Advanced - Security - 
 Allow active content to run in files on My Computer. This is disabled by 
 default. Enable it, restart IE and try if it will make #execute_script 
 working.

 Jarmo Pertman
 -
 IT does really matter - http://itreallymatters.net

 On Wednesday, February 13, 2013 10:15:50 PM UTC+2, Jarmo Pertman wrote:

 I just noticed an error in my previous code. I have an extra ' character 
 at the start of src attribute value :(

 Please try again with the following correct code:
 html
   head
 script type=text/javascript 
 src=file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js/script
   /head
   body
 foo
   /body
 /html

 Jarmo Pertman
 -
 IT does really matter - http://itreallymatters.net

 On Wednesday, February 13, 2013 3:14:42 PM UTC+2, enroxorz wrote:

 Please make sure to post your findings. I've been monitoring this 
 because I also have the same issue as you (didn't post because I didn't 
 have anything new to add to this).

 On Tuesday, February 12, 2013 5:51:37 PM UTC-5, captin wrote:

 The issue still exists when trying your suggestion. I will play around 
 with security settings and see if that leads to any resolution.
  
 Thanks!

 On Saturday, February 9, 2013 5:19:14 AM UTC-6, Jarmo Pertman wrote:

 To be honest - i'm not sure where's the problem since i cannot 
 reproduce it on my IE8. I have one idea - create a local html file with 
 the 
 contents:
 html
   head
 script type=text/javascript 
 src='file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js/script
   /head
   body
 foo
   /body
 /html

 Open that file with your internet explorer and try then the 
 JavaScript commands in the developer tools. If they still don't work 
 then 
 it has probably something to do with your IE security settings.

 Jarmo Pertman
 -
 IT does really matter - http://itreallymatters.net


 On Friday, February 8, 2013 5:51:27 PM UTC+2, captin wrote:

 Same result. The script errors just continue to pile up.
  
 Do you think this is a bug? If so, is it a json2.js or a 
 watir-classic issue?
  
 Thanks.
  

 On Friday, February 8, 2013 1:39:14 AM UTC-6, Jarmo Pertman wrote:

 That's sad to hear. What if you run execute_script two times in a 
 row - will you also get an error for the second run?

 Jarmo Pertman
 -
 IT does really matter - http://itreallymatters.net

 On Thursday, February 7, 2013 12:58:36 AM UTC+2, captin wrote:

 Jarmo,
  
 My apologies for the versioning miscommunication. My initial post 
 and initial error messages are correct with Ruby 1.9.3

[wtr-general] Re: Watir vs Watir Classic

2013-01-23 Thread enroxorz
So WATIR (in it's current state) is a combination of both watir-classic and 
watir-webdriver. 

watir-classic is a re-working of the old WATIR API to better conform to 
watir-webdriver, so stuff like browser.text_field(:id, 'whatever').set 
('xxx') wont work in the newer watir-classic api (the identifier is 
now browser.text_field(:id = 'whatever').set ('xxx'), again to conform 
with watir-webdriver api, allowing interchangeability between the two 
without a lot of hassle).

screen_capture is not part of the screenshot class, which is basically 
just browser.screenshot.save('/path/to/image.png'). The big change is that 
it does all the hwnd stuff in the back end. Really cool stuff.

What I recommend is update your scripts to conform with 
watir-classic/watir-webdriver. If you are using more than just IE, then 
really look at watir-webdriver. If you are at a shot that's website is only 
IE compatible then watir-classic is a dream.

I hope that helps.

On Wednesday, January 23, 2013 2:52:02 PM UTC-5, richar...@twtelecom.com 
wrote:

 Just trying to get some general info. I'm starting from scratch and 
 installed Watir Classic. I have a collegue who had scripts running using 
 Watir 1.9.1. he installed Watir Classic and none of the scripts work. 
 Things like require 'watir/screen_capture' and require 'watir/logger' were 
 not liked. In general it looks like Watir and Watir Classic are not 
 compatable?  Is it recommended that only watir classic be used?
  
 Thanks,
 Richard


-- 
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: Parallel testing

2012-11-20 Thread enroxorz
Hey there,

A while back the WATIR devs had a page on how to simulate load testing with 
threading. I made a gem out of it that might help.

 gem install watir-load-tester

https://github.com/enroxorz/watir-load-tester

Again, it's really primitive and is just a copy of the article, but it 
might help with Watir-Classic testing.

--enroxorz

On Monday, November 19, 2012 5:29:49 PM UTC-5, Ry wrote:

 What options are available for parallel testing in watir that is similar 
 to Selenium Grid?

 I found WatirGrid, but does it require rails?

 Are there non-rail options?

 Thanks, 

 Ryan


-- 
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] Re: Alert window access issue

2012-10-26 Thread enroxorz
What version of WATIR are you using. Correct me if I am wrong, but if you 
are using pre-3.0 Watir, send_key {TAB} should work...

On Friday, October 26, 2012 6:35:38 AM UTC-4, uday swami wrote:

 browser.alert.set username
 browser.alert.send_key :tab
 browser.alert.set my_password
 browser.alert.ok
 when I did this it just sets same text_field with first username,then 
 :tab and then password so at last that text field has password and curser 
 doesn't go to next field either. It considers :tab as text and not special 
 key. the alert method in its apis uses send_keys in its set method so I 
 also tried to send :tab from there but same result. 

 On Thu, Oct 25, 2012 at 11:00 PM, RJ rj41...@gmail.com javascript:wrote:

 you said 'I tried 
   browser.alert.set :tab
 but I think you meant, you tried
   browser.alert.send_keys :tab

 right?  are you asking about browser.send_keys or browser.alert.set?


 what happens when you do the following?

   browser.alert.set username
   browser.alert.send_key :tab
   browser.alert.set my_password
   browser.alert.ok



  -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-genera...@googlegroups.com javascript:




-- 
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] Double popup issue

2012-10-16 Thread enroxorz
When closing multiple popups in a row, the ruby process is stuck on the 
first one. 

See attached example HTML file to see what I am talking about

watir-classic 3.2 and ruby 1.9.3

b = Watir::Browser.attach(:url, /test/)
b.button(:value = 'Press').click_no_wait
b.alert.close
b.alert.close

Is this a legitimate bug? And if so, is there a work around, or should I 
put in a ticket via github.

-- 
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: Double popup issue

2012-10-16 Thread enroxorz
Oops, forgot attachment

On Tuesday, October 16, 2012 8:48:02 AM UTC-4, enroxorz wrote:

 When closing multiple popups in a row, the ruby process is stuck on the 
 first one. 

 See attached example HTML file to see what I am talking about

 watir-classic 3.2 and ruby 1.9.3

 b = Watir::Browser.attach(:url, /test/)
 b.button(:value = 'Press').click_no_wait
 b.alert.close
 b.alert.close

 Is this a legitimate bug? And if so, is there a work around, or should I 
 put in a ticket via github.


-- 
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: [Wtr-development] Watir 4.0 Released!

2012-10-08 Thread enroxorz
Thanks Jarmo. Good to know :)

On Thursday, October 4, 2012 4:23:45 PM UTC-4, Jarmo Pertman wrote:

 Hi!

 There's no changes file per se, but you can read its README at (
 https://github.com/watir/watir/blob/master/README.md). It's functionality 
 is all new.

 In short, difference between watir 4 when compared with previous versions 
 is that it is now a fully functional watir meta gem, which installs all 
 appropriate gem dependencies for you - on Windows watir-classic and 
 watir-webdriver, on unix platforms only the latter. In addition it allows 
 you to specify which driver to use loading the specified driver 
 automatically.

 Do not confuse watir gem with watir-classic or watir-webdriver gem - it is 
 just a gem which ties them all together. Similar approach is used for 
 RSpec, where rspec gem is just a meta gem specifying all necessary 
 dependencies for RSpec to work.

 Jarmo

 On Thu, Oct 4, 2012 at 10:10 PM, enroxorz enrique...@gmail.comjavascript:
  wrote:

 Hey Jarmo,

 Is there a list of changes available for this release?

 --Enrique


 On Sunday, September 30, 2012 12:00:34 PM UTC-4, Jarmo Pertman wrote:

 Hello everyone!

 I'm happy to announce that Watir 4.0 has been released.
  
 Install this gem with the following command:

 gem install watir

 Then in your test file:

 require watir
 browser = Watir::Browser.new

 Refer to the additional usage at the readme: https://github.com/**
 watir/watir/blob/master/**README.mdhttps://github.com/watir/watir/blob/master/README.md

 With Best Regards,
 Jarmo Pertman


 ___
 Wtr-development mailing list
 wtr-dev...@rubyforge.org javascript:
 http://rubyforge.org/mailman/listinfo/wtr-development




-- 
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: Watir 4.0 Released!

2012-10-04 Thread enroxorz
Hey Jarmo,

Is there a list of changes available for this release?

--Enrique

On Sunday, September 30, 2012 12:00:34 PM UTC-4, Jarmo Pertman wrote:

 Hello everyone!

 I'm happy to announce that Watir 4.0 has been released.
  
 Install this gem with the following command:

 gem install watir

 Then in your test file:

 require watir
 browser = Watir::Browser.new

 Refer to the additional usage at the readme: 
 https://github.com/watir/watir/blob/master/README.md

 With Best Regards,
 Jarmo Pertman


-- 
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: Unable to click buttons in the pop-up when the machine is locked

2012-10-02 Thread enroxorz
Have you looked at this?

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

The latter portion will work with 3.0.0 (3.1.0 and higher will need to use 
the former).

Also, if you are planning on using 3.1 or 3.2 in the future look at this 
post for an odd caveat that I found with Javascript Dialog Boxes and 
onclick events for buttons:

https://groups.google.com/d/topic/watir-general/KeuVqLLmOig/discussion

One last thing. Locking windows causes more headaches than its worth. Do 
you need your windows session to be locked? If not than leave it open. If 
it is a VM and you RDP into that VM, dont RDP. Use a VNC or something else 
instead because once you leave your RDP session it locks.

Hope this helps.

On Monday, October 1, 2012 9:46:42 PM UTC-4, praveen kumar wrote:

 Watir 3.0.0

 On Tuesday, October 2, 2012 1:27:55 AM UTC+5:30, enroxorz wrote:

 What version of Watir are you using? 

 On Monday, October 1, 2012 2:26:35 AM UTC-4, praveen kumar wrote:

  Hi All,

 There is a javascript pop-up. I am handling as shown below. It is 
 working fine only if that window is enabled. 

 If the machine is locked or moving to the another window while 
 execution. Its not working. Is there any way to focus that window after pop 
 up is enabled.

 $ie.wait_until{$ie.javascript_dialog.button('OK').enabled?}
  $ie.javascript_dialog.button('OK').click

 Please let me know your thoughts.

 Thanks,
 Praveen



-- 
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] Get select list text

2012-10-01 Thread enroxorz
I am having the following issue. The API changes for SelectList has 
changed, and caused one of our scripts to fail.

Before 3.0 changed

select name=xxx size=1 
option value=1 selected=selectedXXX/option 
option value=2YYY/option 
option value=3ZZZ/option 
/select 

 b.select_list(:name = 'xxx').value
   XXX
 
After 3.0 changes

select name=xxx size=1 
option value=1 selected=selectedXXX/option 
option value=2YYY/option 
option value=3ZZZ/option 
/select 

 b.select_list(:name = 'xxx').value
   1

How can I get the value as if it were before the 3.0 changes?

-- 
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: Unable to click buttons in the pop-up when the machine is locked

2012-10-01 Thread enroxorz
What version of Watir are you using? 

On Monday, October 1, 2012 2:26:35 AM UTC-4, praveen kumar wrote:

  Hi All,

 There is a javascript pop-up. I am handling as shown below. It is working 
 fine only if that window is enabled. 

 If the machine is locked or moving to the another window while execution. 
 Its not working. Is there any way to focus that window after pop up is 
 enabled.

 $ie.wait_until{$ie.javascript_dialog.button('OK').enabled?}
  $ie.javascript_dialog.button('OK').click

 Please let me know your thoughts.

 Thanks,
 Praveen


-- 
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-Classic does not close Javascript Dialog when button onclick event fired

2012-09-30 Thread enroxorz
When I do the following, the Javascript Dialog does not close (in fact, the 
button click is stuck and does not go any further). Is there a work around?

irb(main):001:0 require 'watir-classic'
irb(main):002:0 b = Watir::Browser.new
irb(main):003:0 b.goto 'file:///c:/test.html'
irb(main):004:0 b.button(:value = Press).click

Watir 3.2.0
Ruby 1.9.3

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

  
  

  
attachment: Ctest.png

[wtr-general] Re: Watir-Classic does not close Javascript Dialog when button onclick event fired

2012-09-30 Thread enroxorz
Thank you so much Jarmo. It works! You are a life saver...

On Sunday, September 30, 2012 12:49:07 PM UTC-4, Jarmo Pertman wrote:

 Yes, you should use #click_no_wait together with Watir Alert API (
 http://watirwebdriver.com/javascript-dialogs/)

 In your case:
 require 'watir-classic'
 b = Watir::Browser.new
 b.goto 'file:///c:/test.html'
 b.button(:value = Press).click_no_wait
 b.alert.ok

 Jarmo Pertman
 -
 IT does really matter - http://itreallymatters.net


 On Sunday, September 30, 2012 7:27:07 PM UTC+3, enroxorz wrote:

 When I do the following, the Javascript Dialog does not close (in fact, 
 the button click is stuck and does not go any further). Is there a work 
 around?

 irb(main):001:0 require 'watir-classic'
 irb(main):002:0 b = Watir::Browser.new
 irb(main):003:0 b.goto 'file:///c:/test.html'
 irb(main):004:0 b.button(:value = Press).click

 Watir 3.2.0
 Ruby 1.9.3



-- 
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] Issue transitioning from 2.0.4 to 3.1.0

2012-08-22 Thread enroxorz
Unfortunately the site hasnt been released to the public yet and is only 
internal. I am building a suite of regression scripts at this time for it 
(coinciding with the upgrade to 1.9.3 ruby and 3.1.0 WATIR).

Is there anything else I can give you? 

On Wednesday, August 22, 2012 3:08:07 AM UTC-4, Željko Filipin wrote:

 On Tue, Aug 21, 2012 at 9:53 PM, enroxorz enrique...@gmail.comjavascript: 
 wrote:
  Is there anything else I can give you that might help?

 Link to the page, if it is public. Or link to the page that has the same 
 problem.

 Željko
 --
 filipin.eu 
  

-- 
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] Issue transitioning from 2.0.4 to 3.1.0

2012-08-22 Thread enroxorz
The site is written in ASP.NET, so it's a bit out of my knowledge to be 
honest BUT I did find a work around that somehow doesnt blow up

@browser.select_list(:id = 
ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList).when_present(60).select(/#{value}/)
 
rescue nil

The value is still set AND it doesnt blow up. I am sorry I couldnt get an 
exact error in case it needs to be patched, but at least there is a work 
around for anyone who needs it.

Thanks guys for all the help!

On Wednesday, August 22, 2012 3:08:07 AM UTC-4, Željko Filipin wrote:

 On Tue, Aug 21, 2012 at 9:53 PM, enroxorz enrique...@gmail.comjavascript: 
 wrote:
  Is there anything else I can give you that might help?

 Link to the page, if it is public. Or link to the page that has the same 
 problem.

 Željko
 --
 filipin.eu 
  

-- 
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] Issue transitioning from 2.0.4 to 3.1.0

2012-08-22 Thread enroxorz
Hey Jarmo, 

I ran the line of code you asked me to and it returned 1.

There are only two options in the drop down, YES and NO. I found that after 
I slapped rescue nil at the end, i was able to get passed that step. Not 
optimal, but it will suffice for now. I also found a couple of places where 
this happens, and they all have to deal with ASP.NET postbacks.

I am able to continue with the migration for now. I have run into another 
issue regarding the new Alert API. When I run old execute_script I get the 
following error:

Then /^I kill the popups$/ do
  @browser.execute_script window.confirm = function() { return true; }
  @browser.execute_script window.alert = function() { return true; }
  @browser.execute_script window.prompt = function() { return true; }
end

# features/step_definition/definition.rb:30
(in OLE method `execScript': )
OLE error code:80020101 in Unknown
  Could not complete the operation due to error 80020101.
HRESULT error code:0x80020009
  Exception occurred. (WIN32OLERuntimeError)
./features/step_definition/definition.rb:31:in `/^I kill the popups$/'
features\templates\aih-df1.feature:12:in `Then I kill the popups'

--Enrique

On Wednesday, August 22, 2012 10:20:38 AM UTC-4, Jarmo Pertman wrote:

 Is it possible that your select(/#{value}/) matches more than one option 
 element?

 The code works currently like this:
 1. finds the select element
 2. checks if it is disabled - it is not disabled in your case seeing from 
 the stacktrace
 3. finds all option elements, which match the value
 4. one-by-one checks if option is not disabled and selects it

 It might be, that you will find more than one option elements and when 
 first gets selected then others are disabled (even for some very short 
 period) and then it blows up. Could it be the case?

 Check if more than one option is found like this:

 puts @browser.select_list(:id = 
 ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList).options(:value 
 = /#{value}/).size


 Jarmo Pertman
 -
 IT does really matter - http://itreallymatters.net


 On Wednesday, August 22, 2012 3:46:10 PM UTC+3, enroxorz wrote:

 The site is written in ASP.NET, so it's a bit out of my knowledge to be 
 honest BUT I did find a work around that somehow doesnt blow up

 @browser.select_list(:id = 
 ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList).when_present(60).select(/#{value}/)
  
 rescue nil

 The value is still set AND it doesnt blow up. I am sorry I couldnt get an 
 exact error in case it needs to be patched, but at least there is a work 
 around for anyone who needs it.

 Thanks guys for all the help!

 On Wednesday, August 22, 2012 3:08:07 AM UTC-4, Željko Filipin wrote:

 On Tue, Aug 21, 2012 at 9:53 PM, enroxorz enrique...@gmail.com wrote:
  Is there anything else I can give you that might help?

 Link to the page, if it is public. Or link to the page that has the same 
 problem.

 Željko
 --
 filipin.eu 
  


-- 
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] Issue transitioning from 2.0.4 to 3.1.0

2012-08-21 Thread enroxorz
I am currently transitioning our test servers from Watir 2.0.4 (Ruby 1.8.7) 
to Watir 3.1.0 and I have run into a curious issue.

We are using cucumber to run our scripts, and at one point I get an error:

object {:index=0, :ole_object=#WIN32OLE:0x196d4c0} is disabled 
(Watir::Exception::ObjectDisabledException)


In Watir 2.0.4 I do not receive this error at all, but in 3.1.0 I run the same 
script and the error comes up no matter what (I have put sleeps before it and 
after it).

@browser.select_list(:id = 
ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList).when_present(60).select(/#{value}/)

When I visibly inspect the browser, the select list changes to the value passed 
in, but right after it fails. The element is not disabled at any point of the 
page (even before and after a postback) so I am very confused when that same 
piece of code runs fine in 2.0.4 but not 3.1.0.


Any help would be greatly appreciated


--Enrique

-- 
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] Issue transitioning from 2.0.4 to 3.1.0

2012-08-21 Thread enroxorz
Al,

The step passes. No error is thrown. I then tried to remove the 
when_present(60) portion, but the same error occurred. I also re-arranged 
the other steps so that the one in question is set to last and the error 
still happens. The most peculiar thing is that the drop down is set but 
then fails right afterwards.

--Enrique

On Tuesday, August 21, 2012 11:26:57 AM UTC-4, Al Snow wrote:

  Enrique,

 If you do just the first two parts: @browser.select_list(:id = 
 ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList), what happens?

 Al

 --
 Date: Tue, 21 Aug 2012 07:40:48 -0700
 From: enrique...@gmail.com javascript:
 To: watir-...@googlegroups.com javascript:
 Subject: [wtr-general] Issue transitioning from 2.0.4 to 3.1.0

 I am currently transitioning our test servers from Watir 2.0.4 (Ruby 
 1.8.7) to Watir 3.1.0 and I have run into a curious issue.

 We are using cucumber to run our scripts, and at one point I get an error:

 object {:index=0, :ole_object=#WIN32OLE:0x196d4c0} is disabled 
 (Watir::Exception::ObjectDisabledException)


 In Watir 2.0.4 I do not receive this error at all, but in 3.1.0 I run the 
 same script and the error comes up no matter what (I have put sleeps before 
 it and after it).

 @browser.select_list(:id = 
 ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList).when_present(60).select(/#{value}/)

 When I visibly inspect the browser, the select list changes to the value 
 passed in, but right after it fails. The element is not disabled at any point 
 of the page (even before and after a postback) so I am very confused when 
 that same piece of code runs fine in 2.0.4 but not 3.1.0.


 Any help would be greatly appreciated


 --Enrique


 -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-genera...@googlegroups.com javascript:
  

-- 
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] Issue transitioning from 2.0.4 to 3.1.0

2012-08-21 Thread enroxorz
One more thing, I have a stacktrace that might help. I extracted all watir 
related lines and put it in a seperate field.

C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/elemen
t.rb:71:in `assert_enabled': object {:index=0, 
:ole_object=#WIN32OLE:0x1a19c4
8} is disabled (Watir::Exception::ObjectDisabledException)
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/element.rb:413:in
 
`perform_action'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/input_elements.rb:96:in
 
`select'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/input_elements.rb:42:in
 
`each'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/input_elements.rb:42:in
 
`block in select'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/element.rb:415:in
 
`perform_action'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/input_elements.rb:37:in
 
`select'
from cl-load-no-wait.rb:34:in `main'

On Tuesday, August 21, 2012 1:20:07 PM UTC-4, enroxorz wrote:

 Al,

 The step passes. No error is thrown. I then tried to remove the 
 when_present(60) portion, but the same error occurred. I also re-arranged 
 the other steps so that the one in question is set to last and the error 
 still happens. The most peculiar thing is that the drop down is set but 
 then fails right afterwards.

 --Enrique

 On Tuesday, August 21, 2012 11:26:57 AM UTC-4, Al Snow wrote:

  Enrique,

 If you do just the first two parts: @browser.select_list(:id = 
 ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList), what happens?

 Al

 --
 Date: Tue, 21 Aug 2012 07:40:48 -0700
 From: enrique...@gmail.com
 To: watir-...@googlegroups.com
 Subject: [wtr-general] Issue transitioning from 2.0.4 to 3.1.0

 I am currently transitioning our test servers from Watir 2.0.4 (Ruby 
 1.8.7) to Watir 3.1.0 and I have run into a curious issue.

 We are using cucumber to run our scripts, and at one point I get an error:

 object {:index=0, :ole_object=#WIN32OLE:0x196d4c0} is disabled 
 (Watir::Exception::ObjectDisabledException)


 In Watir 2.0.4 I do not receive this error at all, but in 3.1.0 I run the 
 same script and the error comes up no matter what (I have put sleeps before 
 it and after it).

 @browser.select_list(:id = 
 ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList).when_present(60).select(/#{value}/)

 When I visibly inspect the browser, the select list changes to the value 
 passed in, but right after it fails. The element is not disabled at any 
 point of the page (even before and after a postback) so I am very confused 
 when that same piece of code runs fine in 2.0.4 but not 3.1.0.


 Any help would be greatly appreciated


 --Enrique


 -- 
 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-genera...@googlegroups.com
  


-- 
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] Issue transitioning from 2.0.4 to 3.1.0

2012-08-21 Thread enroxorz



I got an idea from the waiting page from watirwebdriver.com, and I 
implemented it, but the same error occurs. In fact, it happens after the 
value is set then blows up. Is there anymore info you need?
 

Watir::Wait.until { @browser.select_list(:id = 
ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList).enabled? }

@browser.select_list(:id = 
ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList).when_present(60).select(/#{value}/)


On Tuesday, August 21, 2012 1:47:58 PM UTC-4, Al Snow wrote:

  Three interesting references:

- 

 http://stackoverflow.com/questions/9215713/watir-webdriver-clicking-javascript-button
- http://watirwebdriver.com/waiting/
- 
http://rubydoc.info/gems/watir-webdriver/0.2.0/Watir/EventuallyPresent


 Al

 --
 Date: Tue, 21 Aug 2012 10:20:07 -0700
 From: enrique...@gmail.com javascript:
 To: watir-...@googlegroups.com javascript:
 Subject: Re: [wtr-general] Issue transitioning from 2.0.4 to 3.1.0

 Al,

 The step passes. No error is thrown. I then tried to remove the 
 when_present(60) portion, but the same error occurred. I also re-arranged 
 the other steps so that the one in question is set to last and the error 
 still happens. The most peculiar thing is that the drop down is set but 
 then fails right afterwards.

 --Enrique

 On Tuesday, August 21, 2012 11:26:57 AM UTC-4, Al Snow wrote:

  Enrique,

 If you do just the first two parts: @browser.select_list(:id = 
 ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList), what happens?

 Al

 --
 Date: Tue, 21 Aug 2012 07:40:48 -0700
 From: enrique...@gmail.com
 To: watir-...@googlegroups.com
 Subject: [wtr-general] Issue transitioning from 2.0.4 to 3.1.0

 I am currently transitioning our test servers from Watir 2.0.4 (Ruby 
 1.8.7) to Watir 3.1.0 and I have run into a curious issue.

 We are using cucumber to run our scripts, and at one point I get an error:

 object {:index=0, :ole_object=#WIN32OLE:0x196d4c0} is disabled 
 (Watir::Exception::ObjectDisabledException)


 In Watir 2.0.4 I do not receive this error at all, but in 3.1.0 I run the 
 same script and the error comes up no matter what (I have put sleeps before 
 it and after it).

 @browser.select_list(:id = 
 ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList).when_present(60).select(/#{value}/)

 When I visibly inspect the browser, the select list changes to the value 
 passed in, but right after it fails. The element is not disabled at any point 
 of the page (even before and after a postback) so I am very confused when 
 that same piece of code runs fine in 2.0.4 but not 3.1.0.


 Any help would be greatly appreciated


 --Enrique


 -- 
 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-genera...@googlegroups.com
  

 -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-genera...@googlegroups.com javascript:
  

-- 
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] Issue transitioning from 2.0.4 to 3.1.0

2012-08-21 Thread enroxorz
I just realized something, and I am sorry for the inundation of emails

I realized that after the value is set, a postback is done (the site is in 
ASP.NET). Could the assertion of it being enabled be called again after the 
postback? And in that split second, the element might be disabled due to it 
not being there?

On Tuesday, August 21, 2012 2:16:06 PM UTC-4, enroxorz wrote:


 I got an idea from the waiting page from watirwebdriver.com, and I 
 implemented it, but the same error occurs. In fact, it happens after the 
 value is set then blows up. Is there anymore info you need?
  

 Watir::Wait.until { @browser.select_list(:id = 
 ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList).enabled? }

 @browser.select_list(:id = 
 ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList).when_present(60).select(/#{value}/)


 On Tuesday, August 21, 2012 1:47:58 PM UTC-4, Al Snow wrote:

  Three interesting references:

- 

 http://stackoverflow.com/questions/9215713/watir-webdriver-clicking-javascript-button
- http://watirwebdriver.com/waiting/
- 
http://rubydoc.info/gems/watir-webdriver/0.2.0/Watir/EventuallyPresent


 Al

 --
 Date: Tue, 21 Aug 2012 10:20:07 -0700
 From: enrique...@gmail.com
 To: watir-...@googlegroups.com
 Subject: Re: [wtr-general] Issue transitioning from 2.0.4 to 3.1.0

 Al,

 The step passes. No error is thrown. I then tried to remove the 
 when_present(60) portion, but the same error occurred. I also re-arranged 
 the other steps so that the one in question is set to last and the error 
 still happens. The most peculiar thing is that the drop down is set but 
 then fails right afterwards.

 --Enrique

 On Tuesday, August 21, 2012 11:26:57 AM UTC-4, Al Snow wrote:

  Enrique,

 If you do just the first two parts: @browser.select_list(:id = 
 ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList), what happens?

 Al

 --
 Date: Tue, 21 Aug 2012 07:40:48 -0700
 From: enrique...@gmail.com
 To: watir-...@googlegroups.com
 Subject: [wtr-general] Issue transitioning from 2.0.4 to 3.1.0

 I am currently transitioning our test servers from Watir 2.0.4 (Ruby 
 1.8.7) to Watir 3.1.0 and I have run into a curious issue.

 We are using cucumber to run our scripts, and at one point I get an error:

 object {:index=0, :ole_object=#WIN32OLE:0x196d4c0} is disabled 
 (Watir::Exception::ObjectDisabledException)


 In Watir 2.0.4 I do not receive this error at all, but in 3.1.0 I run the 
 same script and the error comes up no matter what (I have put sleeps before 
 it and after it).

 @browser.select_list(:id = 
 ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList).when_present(60).select(/#{value}/)

 When I visibly inspect the browser, the select list changes to the value 
 passed in, but right after it fails. The element is not disabled at any 
 point of the page (even before and after a postback) so I am very confused 
 when that same piece of code runs fine in 2.0.4 but not 3.1.0.


 Any help would be greatly appreciated


 --Enrique


 -- 
 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-genera...@googlegroups.com
  

 -- 
 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-genera...@googlegroups.com
  


-- 
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] Issue transitioning from 2.0.4 to 3.1.0

2012-08-21 Thread enroxorz
Hey  Željko,

I tried that way, but still got the object was disabled. Somehow it changes 
the value, postback to the site, and a new field shows up under it, then 
bombs on me. Is there anything else I can give you that might help?

On Tuesday, August 21, 2012 3:35:13 PM UTC-4, Željko Filipin wrote:

 On Tue, Aug 21, 2012 at 7:26 PM, enroxorz enrique...@gmail.comjavascript: 
 wrote:
  
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/elemen
  t.rb:71:in `assert_enabled': object {:index=0, 
 :ole_object=#WIN32OLE:0x1a19c4
  8} is disabled (Watir::Exception::ObjectDisabledException)

 The error message says the object is disabled.

 Try something like this:

 Watir::Wait.until { @browser.select_list(:id = 
 ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList).enabled? }
 @browser.select_list(:id = 
 ctl00_cphWizard_Content_QuestionField0_QuestionDropDownList).when_present(60).select(/#{value}/)

 More info: http://watirwebdriver.com/waiting/

 Željko
 --
 filipin.eu


-- 
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: Watir-Classic 3.1.0 Released!

2012-08-20 Thread enroxorz
Is there any more documentation on the Screenshot API besides the Spec?

On Monday, August 20, 2012 7:31:11 AM UTC-4, Jarmo Pertman wrote:

 Hello everyone!

 I'm happy to announce that another version of Watir-Classic has just been
  released - 3.1.0.

 Changelog:
 * Add Browser#name, which returns :ie.
 * Add Dl#to_hash.
 * Add support for Alert API (
 https://github.com/watir/watirspec/blob/master/alert_spec.rb).
 * Add support for Browser#screenshot API (
 https://github.com/watir/watirspec/blob/master/screenshot_spec.rb).
 * Browser#execute_script returns now correct Ruby objects instead of 
 String.
 * Browser#new accepts ignored parameter to make API more compatible with 
 Watir-WebDriver.
 * Element#drag_and_drop methods work also with elements not in the 
 viewport.
 * Fix TextField#set slow text entry.
 * Remove all show_* methods. Use element collection methods with #each 
 instead. For example browser.links.each {|link| puts link.href}.
 * Remove already deprecated Watir::Waiter. Use Watir::Wait instead.
 * Remove already deprecated WinClicker.
 * Remove Browser#(javascript_)dialog. Use Browser#alert API instead.
 * Remove ScreenCapture module. Use Browser#screenshot API instead.
 * Remove Watir console. Use regular IRB or debugger instead.
 * Remove Watir.log method, WatirLogger and DefaultLogger classes. Use 
 standard Ruby Logger instead.
 * Remove Watir.until_with_timeout. Use Watir::Wait.until instead.

 Please try it out by executing:
 gem install watir watir-classic

 With best regards,
 Jarmo Pertman


-- 
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: Watir + win32/screenshot = screen shots when script ends/fails?

2012-03-27 Thread enroxorz
After do |scenario|
if scenario.failed?
  @browser.maximize
  screenshot = /FAILED_#{scenario.name.gsub(' ','_').gsub(/[^0-9A-Za-z_]/, 
'')}_#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}.png
  Win32::Screenshot::Take.of(:window, :title = /Windows Internet 
Explorer/).write(screenshot)
  embed screenshot, 'image/png'
end
end



On Tuesday, March 27, 2012 12:23:21 PM UTC-4, Ry wrote:

 Wondering if possible to snap shot the last screen / event my script was 
 on when it finds an error / ends. I am using logging as well, but my 
 employer is requesting screen shots to go hand in hand with the logs to 
 show other users where the error on sites are. I pinged irc and got 
 response that cucumber is good for this. I have seen the article on 
 watirmelon site, but I am not using cucumber unfortunately. I am hoping to 
 continue using watir in it's purest form. 

 Thanks for any examples, leads, or suggestions that might stir me to my 
 goal. 

 Ry


-- 
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: Watir + win32/screenshot = screen shots when script ends/fails?

2012-03-27 Thread enroxorz
Worry, missed that last part. For pure watir (not including Test::Unit)

begin
  [watir script]
rescue
  screenshot = /FAILED_#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}.png
  Win32::Screenshot::Take.of(:window, :title = /Windows Internet 
Explorer/).write(screenshot)
end

Does that help?

On Tuesday, March 27, 2012 2:56:39 PM UTC-4, enroxorz wrote:

 After do |scenario|
 if scenario.failed?
   @browser.maximize
   
   embed screenshot, 'image/png'
 end
 end



 On Tuesday, March 27, 2012 12:23:21 PM UTC-4, Ry wrote:

 Wondering if possible to snap shot the last screen / event my script was 
 on when it finds an error / ends. I am using logging as well, but my 
 employer is requesting screen shots to go hand in hand with the logs to 
 show other users where the error on sites are. I pinged irc and got 
 response that cucumber is good for this. I have seen the article on 
 watirmelon site, but I am not using cucumber unfortunately. I am hoping to 
 continue using watir in it's purest form. 

 Thanks for any examples, leads, or suggestions that might stir me to my 
 goal. 

 Ry



-- 
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: Watir + win32/screenshot = screen shots when script ends/fails?

2012-03-27 Thread enroxorz
No worries, any time :)

On Tuesday, March 27, 2012 4:23:33 PM UTC-4, Ry wrote:

 that worked perfectly! Thank you ever so much!

 On Tuesday, March 27, 2012 9:23:21 AM UTC-7, Ry wrote:

 Wondering if possible to snap shot the last screen / event my script was 
 on when it finds an error / ends. I am using logging as well, but my 
 employer is requesting screen shots to go hand in hand with the logs to 
 show other users where the error on sites are. I pinged irc and got 
 response that cucumber is good for this. I have seen the article on 
 watirmelon site, but I am not using cucumber unfortunately. I am hoping to 
 continue using watir in it's purest form. 

 Thanks for any examples, leads, or suggestions that might stir me to my 
 goal. 

 Ry



-- 
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] Timeout error loading IE via watir-webdriver

2012-03-23 Thread enroxorz
Thanks :)

On Thursday, March 22, 2012 2:22:08 PM UTC-4, Oscar.Rieken wrote:

 http://code.google.com/p/​selenium/wiki/​InternetExplorerDriverhttp://code.google.com/p/selenium/wiki/InternetExplorerDriver


 On Thu, Mar 22, 2012 at 2:19 PM, enroxorz enrique.j.ma...@gmail.comwrote:

 When I tried to load watir-webdriver via irb I receive the following 
 error. I am trying to load it with IE via Ruby 1.9.2 on Win XP

 irb(main):001:0 require 'watir-webdriver'
 = true
 irb(main):002:0 @browser = Watir::Browser.new :ie
 Timeout::Error: Timeout::Error
 from C:/Ruby192/lib/ruby/1.9.1/net/​protocol.rb:140:in `rescue in 
 rbuf_fi
 ll'
 from C:/Ruby192/lib/ruby/1.9.1/net/​protocol.rb:134:in `rbuf_fill'
 from C:/Ruby192/lib/ruby/1.9.1/net/​protocol.rb:116:in `readuntil'
 from C:/Ruby192/lib/ruby/1.9.1/net/​protocol.rb:126:in `readline'
 from C:/Ruby192/lib/ruby/1.9.1/net/​http.rb:2219:in 
 `read_status_line'
 from C:/Ruby192/lib/ruby/1.9.1/net/​http.rb:2208:in `read_new'
 from C:/Ruby192/lib/ruby/1.9.1/net/​http.rb:1191:in 
 `transport_request'
 from C:/Ruby192/lib/ruby/1.9.1/net/​http.rb:1177:in `request'
 from C:/Ruby192/lib/ruby/1.9.1/net/​http.rb:1170:in `block in 
 request'
 from C:/Ruby192/lib/ruby/1.9.1/net/​http.rb:627:in `start'
 from C:/Ruby192/lib/ruby/1.9.1/net/​http.rb:1168:in `request'
 from 
 C:/Ruby192/lib/ruby/gems/1.9.​1/gems/selenium-webdriver-2.​20.0/lib/s
 elenium/webdriver/remote/http/​default.rb:81:in `response_for'
 from 
 C:/Ruby192/lib/ruby/gems/1.9.​1/gems/selenium-webdriver-2.​20.0/lib/s
 elenium/webdriver/remote/http/​default.rb:43:in `request'
 from 
 C:/Ruby192/lib/ruby/gems/1.9.​1/gems/selenium-webdriver-2.​20.0/lib/s
 elenium/webdriver/remote/http/​common.rb:40:in `call'
 from 
 C:/Ruby192/lib/ruby/gems/1.9.​1/gems/selenium-webdriver-2.​20.0/lib/s
 elenium/webdriver/remote/​bridge.rb:594:in `raw_execute'
 from 
 C:/Ruby192/lib/ruby/gems/1.9.​1/gems/selenium-webdriver-2.​20.0/lib/s
 elenium/webdriver/remote/​bridge.rb:92:in `create_session'
 from 
 C:/Ruby192/lib/ruby/gems/1.9.​1/gems/selenium-webdriver-2.​20.0/lib/s
 elenium/webdriver/remote/​bridge.rb:68:in `initialize'
 from 
 C:/Ruby192/lib/ruby/gems/1.9.​1/gems/selenium-webdriver-2.​20.0/lib/s
 elenium/webdriver/ie/bridge.​rb:39:in `initialize'
 from 
 C:/Ruby192/lib/ruby/gems/1.9.​1/gems/selenium-webdriver-2.​20.0/lib/s
 elenium/webdriver/common/​driver.rb:35:in `new'
 from 
 C:/Ruby192/lib/ruby/gems/1.9.​1/gems/selenium-webdriver-2.​20.0/lib/s
 elenium/webdriver/common/​driver.rb:35:in `for'
 from 
 C:/Ruby192/lib/ruby/gems/1.9.​1/gems/selenium-webdriver-2.​20.0/lib/s
 elenium/webdriver.rb:61:in `for'
 from 
 C:/Ruby192/lib/ruby/gems/1.9.​1/gems/watir-webdriver-0.5.3/​lib/watir
 -webdriver/browser.rb:35:in `initialize'
 from (irb):2:in `new'
 from (irb):2
 from C:/Ruby192/bin/irb:12:in `main'irb(main):003:0
  
 -- 
 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-generalhttp://groups.google.com/group/watir-general
 watir-general+unsubscribe@​googlegroups.comwatir-general%2bunsubscr...@googlegroups.com




-- 
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: screenshots with watir (not webdriver)

2012-02-28 Thread enroxorz
What is the error you are getting? Also, note that rautomation 0.6.3
and 0.7.0 throws an error. Did you update to the latest
win32screenshot?

On Feb 28, 2:52 pm, hillary weimar1...@gmail.com wrote:
 any reason why win32/screenshot would have a problem?







 On Tuesday, February 28, 2012 7:10:43 AM UTC-8, Jarmo Pertman wrote:

  No, there shouldn't be any difference how the browser object is
  created since RAutomation doesn't depend on Watir at all and the
  dependency between Watir-RAutomation shouldn't play any role in here
  either...

  Jarmo

  On Feb 28, 2:42 am, hillary weimar1...@gmail.com wrote:
   so it's not working, because the latest version of rautomation having a
   problem with how taza starts up the watir browser event.
       def self.watir_ie(params)
         require 'watir'
         puts running watir
         if params[:attach]
           browser = Watir::IE.find(:title, //)
           end
         browser || Watir::IE.new
        end
     end

   I'm sure it's the latest version, because with the previous version of
   rautomation and the pre release version of watir i didn't get a 'no such
   file to load -- watir/ie' error. i can't change the code snippet because
   for some reason taza tries to open firefox.

   Any reason why the latest version of rautomation would have a problem
  with
   starting the browser with b = Watir::IE.new?

   On Thursday, February 23, 2012 4:57:04 AM UTC-8, Jarmo Pertman wrote:

Yes, since that method is deleted a long time ago already. Use
Win32::Screenshot instead.

First, install Win32::Screenshot
    gem install win32screenshot

Then, take the screenshot by providing browser.rautomation as a
parameter:
    Win32::Screenshot::Take.of(:rautomation,
browser.rautomation).write(screenshot.png)

More examples athttps://github.com/jarmo/win32screenshot

Jarmo Pertman
-
IT does really matter -http://itreallymatters.net

On Feb 23, 2:30 am, hillary weimar1...@gmail.com wrote:
 for the pre-release version of watir (3.0.rc2) I get a no method
  error

 my code:
 browser.screen_capture($file_path,true,false)
 On Tuesday, February 28, 2012 7:10:43 AM UTC-8, Jarmo Pertman wrote:

  No, there shouldn't be any difference how the browser object is
  created since RAutomation doesn't depend on Watir at all and the
  dependency between Watir-RAutomation shouldn't play any role in here
  either...

  Jarmo

  On Feb 28, 2:42 am, hillary weimar1...@gmail.com wrote:
   so it's not working, because the latest version of rautomation having a
   problem with how taza starts up the watir browser event.
       def self.watir_ie(params)
         require 'watir'
         puts running watir
         if params[:attach]
           browser = Watir::IE.find(:title, //)
           end
         browser || Watir::IE.new
        end
     end

   I'm sure it's the latest version, because with the previous version of
   rautomation and the pre release version of watir i didn't get a 'no such
   file to load -- watir/ie' error. i can't change the code snippet because
   for some reason taza tries to open firefox.

   Any reason why the latest version of rautomation would have a problem
  with
   starting the browser with b = Watir::IE.new?

   On Thursday, February 23, 2012 4:57:04 AM UTC-8, Jarmo Pertman wrote:

Yes, since that method is deleted a long time ago already. Use
Win32::Screenshot instead.

First, install Win32::Screenshot
    gem install win32screenshot

Then, take the screenshot by providing browser.rautomation as a
parameter:
    Win32::Screenshot::Take.of(:rautomation,
browser.rautomation).write(screenshot.png)

More examples athttps://github.com/jarmo/win32screenshot

Jarmo Pertman
-
IT does really matter -http://itreallymatters.net

On Feb 23, 2:30 am, hillary weimar1...@gmail.com wrote:
 for the pre-release version of watir (3.0.rc2) I get a no method
  error

 my code:
 browser.screen_capture($file_path,true,false)
 On Tuesday, February 28, 2012 7:10:43 AM UTC-8, Jarmo Pertman wrote:

  No, there shouldn't be any difference how the browser object is
  created since RAutomation doesn't depend on Watir at all and the
  dependency between Watir-RAutomation shouldn't play any role in here
  either...

  Jarmo

  On Feb 28, 2:42 am, hillary weimar1...@gmail.com wrote:
   so it's not working, because the latest version of rautomation having a
   problem with how taza starts up the watir browser event.
       def self.watir_ie(params)
         require 'watir'
         puts running watir
         if params[:attach]
           browser = Watir::IE.find(:title, //)
           end
         browser || Watir::IE.new
        end
     end

   I'm sure it's the latest version, because with the previous version of
   rautomation and the pre release version of watir i didn't get a 'no such
   file to load -- watir/ie' error. i can't change the code 

[wtr-general] Re: screenshots with watir (not webdriver)

2012-02-24 Thread enroxorz
Is there anything you need from me to figure out why it isnt working
for me?

On Feb 24, 4:30 am, Jarmo Pertman jarm...@gmail.com wrote:
 That's weird. I'm not seeing that error with 1.0.11 and everything
 seems to be working for me.

 Jarmo

 On Feb 23, 4:59 pm, enroxorz enrique.j.ma...@gmail.com wrote:







  Just as a quick FYI, win32screenshot gem only works with ffi gem
  1.0.9. If you have 1.0.11 you will get this error:

  c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in
  `gem_original
  _require'
  c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in
  `require'
  c:/Ruby187/lib/ruby/gems/1.8/gems/ffi-1.0.11-x86-mingw32/lib/ffi.rb:11
  c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in
  `gem_original
  _require'
  c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in
  `require'
  c:/Ruby187/lib/ruby/gems/1.8/gems/win32screenshot-1.0.6/lib/win32/
  screenshot.rb:
  1
  c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:60:in
  `gem_original
  _require'
  c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:60:in
  `require'
  C:/ai/singlerun/features/step_definition/definition.rb:4
  c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
  rb_support/
  rb_language.rb:129:in `load'
  c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
  rb_support/
  rb_language.rb:129:in `load_code_file'
  c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
  runtime/sup
  port_code.rb:171:in `load_file'
  c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
  runtime/sup
  port_code.rb:83:in `load_files!'
  c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
  runtime/sup
  port_code.rb:82:in `each'
  c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
  runtime/sup
  port_code.rb:82:in `load_files!'
  c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
  runtime.rb:
  175:in `load_step_definitions'
  c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
  runtime.rb:
  40:in `run!'
  c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
  cli/main.rb
  :43:in `execute!'
  c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
  cli/main.rb
  :20:in `execute'
  c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/cucumber:14
  c:/Ruby187/bin/cucumber:19:in `load'
  c:/Ruby187/bin/cucumber:19
  c:/Ruby187/lib/ruby/1.8/fileutils.rb:1207:in `stat': No such file or
  directory -
   output.html (Errno::ENOENT)
          from c:/Ruby187/lib/ruby/1.8/fileutils.rb:1207:in `lstat'
          from c:/Ruby187/lib/ruby/1.8/fileutils.rb:1185:in `stat'
          from c:/Ruby187/lib/ruby/1.8/fileutils.rb:1267:in `copy_file'
          from c:/Ruby187/lib/ruby/1.8/fileutils.rb:464:in `copy_file'
          from c:/Ruby187/lib/ruby/1.8/fileutils.rb:383:in `cp'
          from c:/Ruby187/lib/ruby/1.8/fileutils.rb:1402:in
  `fu_each_src_dest'
          from c:/Ruby187/lib/ruby/1.8/fileutils.rb:1418:in
  `fu_each_src_dest0'
          from c:/Ruby187/lib/ruby/1.8/fileutils.rb:1400:in
  `fu_each_src_dest'
          from c:/Ruby187/lib/ruby/1.8/fileutils.rb:382:in `cp'
          from process.rb:45

  On Feb 23, 7:57 am, Jarmo Pertman jarm...@gmail.com wrote:

   Yes, since that method is deleted a long time ago already. Use
   Win32::Screenshot instead.

   First, install Win32::Screenshot
       gem install win32screenshot

   Then, take the screenshot by providing browser.rautomation as a
   parameter:
       Win32::Screenshot::Take.of(:rautomation,
   browser.rautomation).write(screenshot.png)

   More examples athttps://github.com/jarmo/win32screenshot

   Jarmo Pertman
   -
   IT does really matter -http://itreallymatters.net

   On Feb 23, 2:30 am, hillary weimar1...@gmail.com wrote:

for the pre-release version of watir (3.0.rc2) I get a no method error

my code:
browser.screen_capture($file_path,true,false)

-- 
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: screenshots with watir (not webdriver)

2012-02-24 Thread enroxorz
Cant you fire up the rdoc server? (gem server)

On Feb 24, 1:16 pm, Chuck van der Linden sqa...@gmail.com wrote:
 On Feb 24, 1:35 am, Jarmo Pertman jarm...@gmail.com wrote:

  I can't remember and can't find anything in changelog either. But it
  was done by someone else and at least feels like long time ago.

  Jarmo

  On Feb 23, 9:02 pm, Chuck van der Linden sqa...@gmail.com wrote:

 1) how can I view the rdoc for the 3.0 stuff before its released?
 2) how can we update the rdoc so that the stuff on screenshot
 describes the new method needed to take screenshots with watir, or
 that the info is somehow included.   blog postings are great, but
 result in a fractured set of documentation that is hard for our users
 to find and reference.









   how long is a long time ago?  the rdoc for 2.0.4 has it listed (http://
   rubydoc.info/gems/watir/2.0.4/Watir/ScreenCapture), and I did not
   notice anything in the release notes for 3.0 about it being removed or
   altered.

   On Feb 23, 4:57 am, Jarmo Pertman jarm...@gmail.com wrote:

Yes, since that method is deleted a long time ago already. Use
Win32::Screenshot instead.

First, install Win32::Screenshot
    gem install win32screenshot

Then, take the screenshot by providing browser.rautomation as a
parameter:
    Win32::Screenshot::Take.of(:rautomation,
browser.rautomation).write(screenshot.png)

More examples athttps://github.com/jarmo/win32screenshot

Jarmo Pertman
-
IT does really matter -http://itreallymatters.net

On Feb 23, 2:30 am, hillary weimar1...@gmail.com wrote:

 for the pre-release version of watir (3.0.rc2) I get a no method error

 my code:
 browser.screen_capture($file_path,true,false)

-- 
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: screenshots with watir (not webdriver)

2012-02-23 Thread enroxorz
Just as a quick FYI, win32screenshot gem only works with ffi gem
1.0.9. If you have 1.0.11 you will get this error:

c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in
`gem_original
_require'
c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in
`require'
c:/Ruby187/lib/ruby/gems/1.8/gems/ffi-1.0.11-x86-mingw32/lib/ffi.rb:11
c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in
`gem_original
_require'
c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in
`require'
c:/Ruby187/lib/ruby/gems/1.8/gems/win32screenshot-1.0.6/lib/win32/
screenshot.rb:
1
c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:60:in
`gem_original
_require'
c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:60:in
`require'
C:/ai/singlerun/features/step_definition/definition.rb:4
c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
rb_support/
rb_language.rb:129:in `load'
c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
rb_support/
rb_language.rb:129:in `load_code_file'
c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
runtime/sup
port_code.rb:171:in `load_file'
c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
runtime/sup
port_code.rb:83:in `load_files!'
c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
runtime/sup
port_code.rb:82:in `each'
c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
runtime/sup
port_code.rb:82:in `load_files!'
c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
runtime.rb:
175:in `load_step_definitions'
c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
runtime.rb:
40:in `run!'
c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
cli/main.rb
:43:in `execute!'
c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/
cli/main.rb
:20:in `execute'
c:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-1.1.9/bin/cucumber:14
c:/Ruby187/bin/cucumber:19:in `load'
c:/Ruby187/bin/cucumber:19
c:/Ruby187/lib/ruby/1.8/fileutils.rb:1207:in `stat': No such file or
directory -
 output.html (Errno::ENOENT)
from c:/Ruby187/lib/ruby/1.8/fileutils.rb:1207:in `lstat'
from c:/Ruby187/lib/ruby/1.8/fileutils.rb:1185:in `stat'
from c:/Ruby187/lib/ruby/1.8/fileutils.rb:1267:in `copy_file'
from c:/Ruby187/lib/ruby/1.8/fileutils.rb:464:in `copy_file'
from c:/Ruby187/lib/ruby/1.8/fileutils.rb:383:in `cp'
from c:/Ruby187/lib/ruby/1.8/fileutils.rb:1402:in
`fu_each_src_dest'
from c:/Ruby187/lib/ruby/1.8/fileutils.rb:1418:in
`fu_each_src_dest0'
from c:/Ruby187/lib/ruby/1.8/fileutils.rb:1400:in
`fu_each_src_dest'
from c:/Ruby187/lib/ruby/1.8/fileutils.rb:382:in `cp'
from process.rb:45

On Feb 23, 7:57 am, Jarmo Pertman jarm...@gmail.com wrote:
 Yes, since that method is deleted a long time ago already. Use
 Win32::Screenshot instead.

 First, install Win32::Screenshot
     gem install win32screenshot

 Then, take the screenshot by providing browser.rautomation as a
 parameter:
     Win32::Screenshot::Take.of(:rautomation,
 browser.rautomation).write(screenshot.png)

 More examples athttps://github.com/jarmo/win32screenshot

 Jarmo Pertman
 -
 IT does really matter -http://itreallymatters.net

 On Feb 23, 2:30 am, hillary weimar1...@gmail.com wrote:







  for the pre-release version of watir (3.0.rc2) I get a no method error

  my code:
  browser.screen_capture($file_path,true,false)

-- 
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: screenshots with watir (not webdriver)

2012-02-22 Thread enroxorz
Is there a small write up on how to use this?

Basically, is it part of the browser object like this:

@browser.text_field(:id = 'something').set
@browser.screen_capture('temp.jpg',true,false)

or is it more like this

@browser.text_field(:id = 'something').set
screen_capture('temp.jpg',true,false)

On Feb 22, 2:40 pm, Chuck van der Linden sqa...@gmail.com wrote:
 yes there is a screenshot method.   
 seehttp://rubydoc.info/gems/watir/2.0.4/Watir/ScreenCapture#screen_captu...

 On Feb 22, 10:50 am, hillary weimar1...@gmail.com wrote:







  is there a built in method for taking screenshots with watir? either 2.0 or
  3.0.

-- 
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: Test Management GUI for Watir

2011-12-15 Thread enroxorz
I second the idea of Cucumber. I created some in-house process for our
QA team to upload features and run cucumber, but beyond that the
'output html' argument is amazing. Really changed our QA process.

On Dec 15, 1:57 pm, Chuck van der Linden sqa...@gmail.com wrote:
 As Dave suggests, Fitnesse is one way to go.  Another is Cucumber

 Both of these take a bit of a different direction from Quality Center

 Instead of  creating a mapping between requirements, specs, and tests,
 they focus more around the idea of creating an executable
 requirement.  You express a description of the requirement in a
 specific format which allows it to directly drive the code steps that
 will exercise the functionality being described.  The spec becomes the
 test in this sense, which ensures that no mapping is needed and specs
 tend to stay updated and 'in sync' with the current code in order for
 the tests to continue to pass should the behavior of the app change by
 design.

 You can learn more about Cucumber at their site  www.cukes.info and I
 highly recommend the new 'Cucumber Book' from Pragmatic Programmers
 (available in E format now, print due fairly soon)

 A simple example of using Cucumber with Watir, along with a Page
 Object pattern (a very useful abstraction layer technique) by Alister
 Scott is on the Watir.com blog 
 here:http://watir.com/2011/01/22/simple-cucumber-watir-page-object-pattern...

 The general idea of creating your specs via examples of how the code
 should behave (aka BDD, ATDD) is very well presented in the book
 'Specification by Example' by Gojko Adzic.   Alister also did an
 introduction to this way of working in a pdf you can download from his
 blog 
 here:http://watirmelon.com/2011/05/18/specification-by-example-a-love-story/

 You can find some very useful and entertaining videos of presentations
 by Gojko and others in the 'podcast' section 
 athttp://skillsmatter.com/go/agile-testing.
 There are several years worth of podcasts there but only the most
 recent are listed.  However if you search the site for keywords like
 BDD, Page Objects, ATDD, Watir, etc you will find a bunch more
 material (for example this one :http://skillsmatter.com/podcast/home/
 bootstrapping-cucumber-mnchhausen-style and this 
 one:http://skillsmatter.com/podcast/agile-scrum/bdd-atdd-and-page-objects
 which is doing Selenium but still helps to understand the page object
 pattern)

 On Dec 14, 11:02 pm, Dave McNulla mcnu...@gmail.com wrote:







 http://www.opensourcetestmanagement.com/
  The only one in the list that I've used was Fitnesse. You may already have
  tools that work well with Watir. for instance, if you use confluence, you
  can try this:http://watirmelon.com/2008/04/13/watir-tests-from-wiki-page/

  Good luck,

  Dave

-- 
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: Need file_field assistance

2011-08-12 Thread enroxorz
Hey Jarmo,

I tried the ENV change and I am still getting the same issue. I am
reverting back to WATIR 1.8.1 to see if it is an issue with my
scripts. I'll get back to you when I get more info...

Thanks
--Enrique

On Aug 12, 9:55 am, watirboy enrique.j.ma...@gmail.com wrote:
 Hey Jarmo,

 Thanks for the reply

 Here is the error I am getting. It is a timeout error with
 RAutomation.

 timed out after 60 seconds (RAutomation::WaitHelper::TimeoutError)

 It happens sporadically through out the script.

 Thanks for the ENV variable. Let me try this and get back to you to
 see if it works.

 --Enrique

 On Aug 12, 8:41 am, Jarmo Pertman jarm...@gmail.com wrote:







  Does it fail for you consistently or does it handle some of the file
  fields and then fail? Do you see any error messages after some period
  of time (default is 60 seconds)?

  Try to use AutoIt adapter to see if that makes any difference. Add
  this line before your #file_field.each line:
  ENV[RAUTOMATION_ADAPTER] = :autoit

  Jarmo

  On Aug 11, 11:58 pm, watirboy enrique.j.ma...@gmail.com wrote:

   Hey Everyone

   Before the inclusion of rautomation in WATIR 1.9 I was able to do the
   following without much of a problem

   file = File.expand_path(File.dirname(__FILE__) + '/files/
   testdoc.doc').gsub!('/','\\')
   browser.file_fields.each do |file_field|
     file_field.set(file)
   end

   There was a page with a set of fields that we looped through.

   For some reason the Open dialog box gets stuck and kills the rest of
   the test suite.

   Does anyone have a suggestion for a work around or a new way of doing
   this? Is this a known bug withing WATIR and rautomation?

   Thank you for your help.

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