Thanks much that worked like a charm...though I do question the
advisability of having to change underlying code if I ever have to
reinstall.

Thanks again...on to the next task.

On Mar 17, 11:01 am, Ethan <[email protected]> wrote:
> This is due to a change between ruby 1.8 and 1.9 in how the syntax ?x is
> interpreted, where x is any character.
> You can change the screen_capture.rb file. Every instance of ?x needs to be
> replaced with 'x'.getbyte(0)
> so the line:
>
>       keybd_event.Call(vkKeyScan.Call(?F), 1, 0, 0)
>
> should become:
>
>       keybd_event.Call(vkKeyScan.Call('F'.getbyte(0)), 1, 0, 0)
> and so on.
>
> On Tue, Mar 16, 2010 at 19:28, barb <[email protected]> wrote:
> > Hi,
> >  I have written a quick little program to see how to use
> > screen_capture and am having an error condition that I am not able to
> > resolve. I suspect it is an easy fix.I will share the code from the
> > program and command line error generated.
>
> > Thanks in advance.
> > =======================================================
> > Code is as follows
> > =======================================================
> > require 'watir'
> > require 'watir/screen_capture'
> > include Watir::ScreenCapture
>
> > browser = Watir::Browser.start  "https://xx.xxx.x.xx/iws/";
> > browser.text_field(:name, "j_username").set("supervisor1")
> > browser.text_field(:name, "j_password").set("Pwd")
> > browser.button(:value,"Sign-In").click
>
> > Watir::Waiter::wait_until {browser.div(:text, "Produce").exists? }
>
> > #click on the Produce blue bar
> > browser.div(:text, "Produce").click
>
> > #Click on New
> > browser.div(:text,"New").click
>
> > #Click on Project
> > browser.link(:text,"Project").click
>
> > #create a new project.
> > browser.frame(:name, "a2IFrame").form(:id,
> > 'a2Object').text_field(:name, 'value(name)').set('capture test')
>
> > #do a screen capture
> >  file_name='c:\a2web\projec.jpg'
> > screen_capture(file_name, true)
>
> > browser.close()
> > ====================================================================
> > Here is the error that appears
> > ====================================================================
> > screencapproj.rb(main):027:0*    file_name='c:\a2web\projec.jpg'
> > => "c:\\a2web\\projec.jpg"
> > screencapproj.rb(main):028:0> screen_capture(file_name, true)
> > TypeError: can't convert String into Integer
> >        from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:21:in `pack'
> >        from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:21:in `block in
> > call'
> >        from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:19:in `each'
> >        from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:19:in
> > `each_with_index'
> >        from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:19:in `call'
> >        from C:/Ruby19/lib/ruby/gems/1.9.1/gems/watir-1.6.5/lib/watir/
> > screen_cap
> > ture.rb:54:in `screen_capture'
> >        from screencapproj.rb:28
> >        from C:/Ruby19/bin/irb:12:in `<main>'
> > screencapproj.rb(main):029:0> #browser.show_all_objects
> > screencapproj.rb(main):030:0*
> > screencapproj.rb(main):031:0*   #puts "divs"
> > screencapproj.rb(main):032:0*   #browser.show_divs
> > screencapproj.rb(main):033:0*
> > screencapproj.rb(main):034:0*   browser.close()
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > You received this message because you are subscribed to
> >http://groups.google.com/group/watir-general
> > To post: [email protected]
> > To unsubscribe: 
> > [email protected]<watir-general%[email protected]>

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

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: [email protected]
To unsubscribe: [email protected]

Reply via email to