Send Text w/ Ruby

I'm curious if it is possible to send text to a window or web
application. I am using the firewatir library, but I don't think you
can do it with that, so just wondering if it is possible with Ruby
itself. Thanks!

On Windows, you can use Win32::GuiTest
<http://raa.ruby-lang.org/project/win32-guitest/&gt;\.

I haven't tried it, though. Here are some instructions on building it
as a gem (it isn't available from Rubygems itself):
<http://gware.blogspot.com/2009/09/building-win32-guitest-gem-on-windows.html&gt;

···

On Wed, Aug 4, 2010 at 9:35 PM, Matthew Barnes <bbaarrnneess@gmail.com> wrote:

I'm curious if it is possible to send text to a window or web
application. I am using the firewatir library, but I don't think you
can do it with that, so just wondering if it is possible with Ruby
itself. Thanks!

Matthew Barnes wrote:

I'm curious if it is possible to send text to a window or web
application. I am using the firewatir library, but I don't think you
can do it with that, so just wondering if it is possible with Ruby
itself. Thanks!

watir itself can populate fields, can it not?
-r

···

--
Posted via http://www.ruby-forum.com/\.

Eric Christopherson wrote:

···

On Wed, Aug 4, 2010 at 9:35 PM, Matthew Barnes <bbaarrnneess@gmail.com> wrote:

I'm curious if it is possible to send text to a window or web
application. I am using the firewatir library, but I don't think you
can do it with that, so just wondering if it is possible with Ruby
itself. Thanks!

On Windows, you can use Win32::GuiTest
<http://raa.ruby-lang.org/project/win32-guitest/&gt;\.

AutoItX is also very handy for scripting Windows apps and the Win32 API.

See http://groups.google.com.kh/group/ruby-talk-google/msg/ca78a0fcf1015a05

for an earlier post I made on this.

--
James Britt

www.jamesbritt.com - Playing with Better Toys
www.ruby-doc.org - Ruby Help & Documentation
www.rubystuff.com - The Ruby Store for Ruby Stuff
www.neurogami.com - Smart application development

Yes it can, but the fields in are encrypted in the html source, so it
is a random string each time you load the page. I am using ruby on a
linux box right now, but I guess if my only options are the windows
api I may have to run a virtual machine.

···

On Aug 5, 9:15 am, Roger Pack <rogerpack2...@gmail.com> wrote:

Matthew Barnes wrote:
> I'm curious if it is possible to send text to a window or web
> application. I am using the firewatir library, but I don't think you
> can do it with that, so just wondering if it is possible with Ruby
> itself. Thanks!

watir itself can populate fields, can it not?
-r
--
Posted viahttp://www.ruby-forum.com/.

It can, but the tags for these fields are encrypted, so every time the
page loads its a different random string!

···

On Aug 5, 9:15 am, Roger Pack <rogerpack2...@gmail.com> wrote:

Matthew Barnes wrote:
> I'm curious if it is possible to send text to a window or web
> application. I am using the firewatir library, but I don't think you
> can do it with that, so just wondering if it is possible with Ruby
> itself. Thanks!

watir itself can populate fields, can it not?
-r
--
Posted viahttp://www.ruby-forum.com/.

If I'm allowed to promote myself...
I wrote a library wrapped around AutoItX3, available as the au3 gem[1].
For Linux systems I wrote xdo (based on the xdotool commandline tool),
but that's undergoing a heavy rework at the moment.

Vale,
Marvin

[1] See also http://auto.rubyforge.org

···

Am 05.08.2010 08:05, schrieb James Britt:

Eric Christopherson wrote:

On Wed, Aug 4, 2010 at 9:35 PM, Matthew Barnes >> <bbaarrnneess@gmail.com> wrote:

I'm curious if it is possible to send text to a window or web
application. I am using the firewatir library, but I don't think you
can do it with that, so just wondering if it is possible with Ruby
itself. Thanks!

On Windows, you can use Win32::GuiTest
<http://raa.ruby-lang.org/project/win32-guitest/&gt;\.

AutoItX is also very handy for scripting Windows apps and the Win32 API.

See http://groups.google.com.kh/group/ruby-talk-google/msg/ca78a0fcf1015a05

for an earlier post I made on this.

Have you looked at the page with Firebug/Firefinder to see if any pattern
can locate the fields? Firewatir doesn't specifically need to know the name
of the field you want to fill in.

As an example, if the field is located inside the same div every time then
you can walk down to it using the div and then grab the only field inside
the div. That would work the same if it was in the 3rd row of a table every
time or any other concept that can be specified to Firewatir.

For certain (well 95%+), if you can XPath the field then you can get to it
via Firewatir.

John

···

On Thu, Aug 5, 2010 at 9:45 AM, Matthew Barnes <bbaarrnneess@gmail.com>wrote:

On Aug 5, 9:15 am, Roger Pack <rogerpack2...@gmail.com> wrote:
> watir itself can populate fields, can it not?
> -r

It can, but the tags for these fields are encrypted, so every time the
page loads its a different random string!

Thanks Marvin! I'll have to check out your xdo tool as I am on a
linux box.

···

On Aug 5, 1:28 am, Quintus <sutn...@gmx.net> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 05.08.2010 08:05, schrieb James Britt:

> Eric Christopherson wrote:
>> On Wed, Aug 4, 2010 at 9:35 PM, Matthew Barnes > >> <bbaarrnne...@gmail.com> wrote:
>>> I'm curious if it is possible to send text to a window or web
>>> application. I am using the firewatir library, but I don't think you
>>> can do it with that, so just wondering if it is possible with Ruby
>>> itself. Thanks!

>> On Windows, you can use Win32::GuiTest
>> <http://raa.ruby-lang.org/project/win32-guitest/&gt;\.

> AutoItX is also very handy for scripting Windows apps and the Win32 API.

> Seehttp://groups.google.com.kh/group/ruby-talk-google/msg/ca78a0fcf1015a05

> for an earlier post I made on this.

If I'm allowed to promote myself...
I wrote a library wrapped around AutoItX3, available as the au3 gem[1].
For Linux systems I wrote xdo (based on the xdotool commandline tool),
but that's undergoing a heavy rework at the moment.

Vale,
Marvin

[1] See alsohttp://auto.rubyforge.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/

iEYEARECAAYFAkxaaBgACgkQDYShvwAbcNmf/wCgnRCEOUPriSy3hqXSrzx5Hxci
rywAoJEw1spMEuj1mtqR1qvrMzvc1706
=xzxV
-----END PGP SIGNATURE-----

I am on a linux box so the win32 api wont work or autoit, but I will
def check out your xdo tool! Thanks!

···

On Aug 5, 1:28 am, Quintus <sutn...@gmx.net> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 05.08.2010 08:05, schrieb James Britt:

> Eric Christopherson wrote:
>> On Wed, Aug 4, 2010 at 9:35 PM, Matthew Barnes > >> <bbaarrnne...@gmail.com> wrote:
>>> I'm curious if it is possible to send text to a window or web
>>> application. I am using the firewatir library, but I don't think you
>>> can do it with that, so just wondering if it is possible with Ruby
>>> itself. Thanks!

>> On Windows, you can use Win32::GuiTest
>> <http://raa.ruby-lang.org/project/win32-guitest/&gt;\.

> AutoItX is also very handy for scripting Windows apps and the Win32 API.

> Seehttp://groups.google.com.kh/group/ruby-talk-google/msg/ca78a0fcf1015a05

> for an earlier post I made on this.

If I'm allowed to promote myself...
I wrote a library wrapped around AutoItX3, available as the au3 gem[1].
For Linux systems I wrote xdo (based on the xdotool commandline tool),
but that's undergoing a heavy rework at the moment.

Vale,
Marvin

[1] See alsohttp://auto.rubyforge.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/

iEYEARECAAYFAkxaaBgACgkQDYShvwAbcNmf/wCgnRCEOUPriSy3hqXSrzx5Hxci
rywAoJEw1spMEuj1mtqR1qvrMzvc1706
=xzxV
-----END PGP SIGNATURE-----

Wow, I did not know this, thanks for the info John! I will def check
this out.

···

On Aug 5, 10:53 am, John W Higgins <wish...@gmail.com> wrote:

[Note: parts of this message were removed to make it a legal post.]

On Thu, Aug 5, 2010 at 9:45 AM, Matthew Barnes <bbaarrnne...@gmail.com>wrote:

> On Aug 5, 9:15 am, Roger Pack <rogerpack2...@gmail.com> wrote:
> > watir itself can populate fields, can it not?
> > -r

> It can, but the tags for these fields are encrypted, so every time the
> page loads its a different random string!

Have you looked at the page with Firebug/Firefinder to see if any pattern
can locate the fields? Firewatir doesn't specifically need to know the name
of the field you want to fill in.

As an example, if the field is located inside the same div every time then
you can walk down to it using the div and then grab the only field inside
the div. That would work the same if it was in the 3rd row of a table every
time or any other concept that can be specified to Firewatir.

For certain (well 95%+), if you can XPath the field then you can get to it
via Firewatir.

John