[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby access to Win Forms application

Jim Knowlton

8/26/2007 12:13:00 AM

I am a QA Engineer implementing a Ruby-based test framework to test
the applications in my organization...the issue I have is about 20% of
what we do is Windows Forms (.NET) applications...can I use Win32OLE
for this, or would I need to use something like Ruby .NET or
IronRuby? Basically the idea of the application under test is that it
makes a socket connection to a server, then the server passes messages
to it. When a message is passed of a particular type, a "screen pop"
is generated. So what I want to do in a Ruby test is to:

1. Set up a mock of the server and establish connection with the
application.
2. Send the application a message which should result in a screen
pop.
3. Verify the screen pop came up.

Anyway...any advice on this is greatly appreciated. I've done some
Ruby work but am a newbie as it pertains to using it to access
Windows.

Jim

5 Answers

Jeremy Wells

8/26/2007 1:32:00 AM

0

Just using the win32 apis with things like FindWindow to check the popup
window is showing?

Jim Knowlton wrote:
> I am a QA Engineer implementing a Ruby-based test framework to test
> the applications in my organization...the issue I have is about 20% of
> what we do is Windows Forms (.NET) applications...can I use Win32OLE
> for this, or would I need to use something like Ruby .NET or
> IronRuby? Basically the idea of the application under test is that it
> makes a socket connection to a server, then the server passes messages
> to it. When a message is passed of a particular type, a "screen pop"
> is generated. So what I want to do in a Ruby test is to:
>
> 1. Set up a mock of the server and establish connection with the
> application.
> 2. Send the application a message which should result in a screen
> pop.
> 3. Verify the screen pop came up.
>
> Anyway...any advice on this is greatly appreciated. I've done some
> Ruby work but am a newbie as it pertains to using it to access
> Windows.
>
> Jim
>
>
>
>


Phlip

8/26/2007 3:19:00 AM

0

Jim Knowlton wrote:

> I am a QA Engineer implementing a Ruby-based test framework to test
> the applications in my organization...the issue I have is about 20% of
>> what we do is Windows Forms (.NET) applications...

The majority of your tests simply must use .NET. They should run as close as
possible to the tested code. Every step farther from that code, the fuzzier
and sloppier the tests get.

In general, there's always a role for tests that are easy to script. Raw
Ruby, or Ruby+YAML, would allow you to invent graceful DSLs that
simultaneously document and test business rules. Yet that's not where you
should start.

> 1. Set up a mock of the server and establish connection with the
> application.
> 2. Send the application a message which should result in a screen
> pop.
> 3. Verify the screen pop came up.

Mock the thing that pops the screen up. You don't need to test the GUI
itself, because you aren't going to refactor or upgrade that. (Hopefully!)
You need tests that cover only your own logic. That logic isn't going
anywhere if a test simply catches its outputs _before_ those outputs go into
the real GUI.

--
Phlip
http://www.oreilly.com/catalog/9780...
"Test Driven Ajax (on Rails)"
assert_xpath, assert_javascript, & assert_ajax


Jim Knowlton

8/26/2007 5:40:00 AM

0

On Aug 25, 6:32 pm, Jeremy Wells <jwe...@servalsystems.co.uk> wrote:
> Just using the win32 apis with things like FindWindow to check the popup
> window is showing?

That's exactly what I'm trying to do...nothing fancy, and I don't need
code-level/unit tests...since I'm the QA guy and not the developer, I
just want to test the app itself to make sure at the user level, it
works the way it should. So I'd think something like a FindWindow
would work perfect...is that accessible through win32ole? Or
something else?


Jim Knowlton

8/26/2007 5:47:00 AM

0

> Mock the thing that pops the screen up. You don't need to test the GUI
> itself, because you aren't going to refactor or upgrade that. (Hopefully!)
> You need tests that cover only your own logic. That logic isn't going
> anywhere if a test simply catches its outputs _before_ those outputs go into
> the real GUI.
>
> --
> Phlip
> http://www.oreilly.com/catalog/9780...
> "Test Driven Ajax (on Rails)"
> assert_xpath, assert_javascript, & assert_ajax

Philip...Thanks for your thoughts...I guess my thought is that since I
am the QA guy, and am not writing the program code (I'd say we do
"moderately rapid but not agile" development), my job is just to
verify that the program works from a user perspective, not to unit-
test the code. So far, I've been using Ruby/Watir to drive the
browser and test our admin utility (which is a web application)...and
that's worked great. The only thing remaining is to be able to
"drive" the win32 client so I can verify it responds appropriately to
messages it gets from the server. I guess my thought is, if I mock up
the client, how do I know the client is working (if I'm not actually
running it)?

Huw Collingbourne

8/26/2007 9:30:00 AM

0

If your main app is in .NET you may want to try our Ruby Connector. This
is currently in beta and will be more generally availabale soon ( watch
the Blog for news! http://www.sapphiresteel.... )

More info here:
http://www.sapphir.../The-Ruby-Connecto...
http://www.sapphir.../From-C-to-Ruby-and-back...
http://www.sapphir.../Visual-Ruby-One-...

best wishes
Huw

SapphireSteel Software
http://www.sapphir...
Ruby Programming In Visual Studio
--
Posted via http://www.ruby-....