Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Ruby (http://www.velocityreviews.com/forums/f66-ruby.html)
-   -   ruby in WinXP as an automation tool (http://www.velocityreviews.com/forums/t821795-ruby-in-winxp-as-an-automation-tool.html)

kevin.gc@gmail.com 05-14-2005 07:05 AM

ruby in WinXP as an automation tool
 
Can anyone tell me if it can be done?


Adelle Hartley 05-14-2005 08:39 AM

Re: ruby in WinXP as an automation tool
 
Hi Kevin,
>
> Can anyone tell me if it can be done?
>


OLE object browser, in Ruby.

http://homepage1.nifty.com/markey/ru...e/index_e.html

Adelle.




James Britt 05-14-2005 12:42 PM

Re: ruby in WinXP as an automation tool
 
kevin.gc@gmail.com wrote:
> Can anyone tell me if it can be done?


Can you give examples of some tasks?

James



ruby talk 05-17-2005 01:33 PM

Re: ruby in WinXP as an automation tool
 
Hello,
AutoIT Does the job well. It has an application that will tell you
window names and lot of nice tools. It uses a vb like lang to program.
Becker

On 5/14/05, Alexey Verkhovsky <alex@verk.info> wrote:
> kevin.gc@gmail.com wrote:
>=20
> >Can anyone tell me if it can be done?
> >
> >

> Yes.
> This is not a very informative answer, I suppose. What kinds of things
> do you want to automate?
>=20
> --
> Best regards,
>=20
> Alexey Verkhovsky
>=20
> Ruby Forum: http://ruby-forum.org (moderator)
> RForum: http://rforum.andreas-s.net (co-author)
> Instiki: http://instiki.org (maintainer)
>=20
>




Martin DeMello 05-17-2005 07:35 PM

Re: ruby in WinXP as an automation tool
 
ruby talk <rubytalk@gmail.com> wrote:
> Hello,
> AutoIT Does the job well. It has an application that will tell you
> window names and lot of nice tools. It uses a vb like lang to program.
> Becker


http://www.rubygarden.org/ruby?AutoIt_For_Windows

martin

Pit Capitain 05-17-2005 08:24 PM

Re: ruby in WinXP as an automation tool
 
Martin DeMello schrieb:
> ruby talk <rubytalk@gmail.com> wrote:
>
>>Hello,
>>AutoIT Does the job well. It has an application that will tell you
>>window names and lot of nice tools. It uses a vb like lang to program.

>
> http://www.rubygarden.org/ruby?AutoIt_For_Windows


I'm also using the AutoIT DLL driven by Ruby scripts. It really works
great and already has saved me a lot of key-presses and mouse-clicks.

Regards,
Pit



Bill Guindon 05-17-2005 09:28 PM

Re: ruby in WinXP as an automation tool
 
On 5/17/05, Pit Capitain <pit@capitain.de> wrote:
> Martin DeMello schrieb:
> > ruby talk <rubytalk@gmail.com> wrote:
> >
> >>Hello,
> >>AutoIT Does the job well. It has an application that will tell you
> >>window names and lot of nice tools. It uses a vb like lang to program.

> >
> > http://www.rubygarden.org/ruby?AutoIt_For_Windows

>=20
> I'm also using the AutoIT DLL driven by Ruby scripts. It really works
> great and already has saved me a lot of key-presses and mouse-clicks.


Anybody have any samples of ruby/au3 scripts that are a bit more in
depth than the wiki example?
=20
> Regards,
> Pit
>=20
>=20



--=20
Bill Guindon (aka aGorilla)



James Britt 05-17-2005 11:48 PM

Re: ruby in WinXP as an automation tool
 
Bill Guindon wrote:
> Anybody have any samples of ruby/au3 scripts that are a bit more in
> depth than the wiki example?


No. But here's a script I just moved over to Ruby.

On a whim I started wrapping methods so that the core script would be a
bit tidier.

# Launch Firefox and check gmail for that
# special v1agr4 offer
require 'win32ole'

def set_up
@au3 = WIN32OLE.new("AutoItX3.Control")
@au3.opt("WinTextMatchMode", 2)
end

def browse_to( url )
@au3.Run( "e:\\Firefox\\firefox.exe #{url}" )
end

def enter
@au3.Send( "{ENTER}" )
end

def tab
@au3.Send( "{TAB}" )
end


def wait( n )
@au3.Sleep( n.to_i )
end

def send s
@au3.Send( s.to_s )
end

def wait_for_title t
@au3.WinWaitActive( t.to_s )
end


set_up
name = 'my.name'
password = 'fake-password'
browse_to 'http://www.gmail.com'
wait_for_title "Welcome to Gmail"
# Make sure whole page has
# load over flakey WiFi
sleep 5
send name
tab
send password
enter
# The end.



James



Bill Guindon 05-18-2005 12:28 AM

Re: ruby in WinXP as an automation tool
 
On 5/17/05, James Britt <james_b@neurogami.com> wrote:
> Bill Guindon wrote:
> > Anybody have any samples of ruby/au3 scripts that are a bit more in
> > depth than the wiki example?

>=20
> No. But here's a script I just moved over to Ruby.
>=20
> On a whim I started wrapping methods so that the core script would be a
> bit tidier.


Thanks much for the example, gives me a good place to start.

--=20
Bill Guindon (aka aGorilla)



James Britt 05-18-2005 01:08 AM

Re: ruby in WinXP as an automation tool
 
Alexey Verkhovsky wrote:
> On 5/17/05, James Britt <james_b@neurogami.com> wrote:
>
>>> No. But here's a script I just moved over to Ruby.
>>>

>
> By the way, if I have a .dll (such as AutoIt) somewhere in
> my_project/ext, and I want it to work in "download, start, No Step Three
> (TM)" manner - no changes to Windows registry, no copying of files to
> c:\WINNT, no other installation to speak of.
>
> In this case, what should this line be preceeded with:
> @au3 = WIN32OLE.new("AutoItX3.Control")



Good question. The DLL is going to get loaded, I think, by the WIN32OLE
wrapper, no? So it needs to know where t look, or the dll has to be
someplace it knows to look.

Does the AutoIT.dll have to be registered (via regsvr32 or something)
before win32ole can use it?

Time to go experiment ...

James




All times are GMT. The time now is 06:11 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.