Generic-user-small Carl Graff 4 posts

Hi,

I have a need to create tests and also “robot” data and actions between a Windows application and a Java application. It is an integration between different systems and I need to extract data out of one aplication load it into anohter application and verify the the results between the two. It may or maynot also include accessing web application for further verification.

Easy huh?

I do have a very good product called test complete that can probalby do most or all of this in conjunction with vb.net and/or ruby calls. TesComplete also has avery nice feature that allows you to inspect the GUI objects in a running app to get handles to the the container and object names and IDs needed for referencing in the tesing / roboting code. It’s scripting language options are vb, javascript, or Delphi.

That being said:
1. I reqally love Ruby and JRuby
2. I would prefer to do it all in one application using RSpec and the win32 api methods and Java swing methods as descibed in this book and not resort to external calls to mixed languages.

So here are a few comments / questions that perhpas someonew could kindly provide feedback on.

1. I have beeen trying to get the win32-api to work in Netbeans / Jruby 1.1.4 but the GEM won’t compile. JRuby 1.1.5 is out but I don’t know how integrate it with netbeans and even if I could I don’t know if will allow use of the win32-api. Anyone have any luck with this?

2. How do you “discover” the container and object names and IDs in Windows and Java apps? Do you think I should just use TestComplete to get the names and IDs to use in the Ruby or JRuby application or is there a better / easier way?

3. In summary if I use JRuby I can easily access Java apps and if I use CRuby I can easily access Windows apps. So should I use JRuby and perhaps JNA or CRuby and see if I can access Java apps from CRuby?

If ayone is interested I’ll keep you abreast with my progress.

Thanks, Carl

 
Generic-user-small Carl Graff 4 posts

Hi All,

I received a response from Daniel Berger stating that they are working on this port using FFI but he couldn’t say when exactly it would be ready.

Best, Carl

 
2201682121_40eda4245f_o_small Ian Dees 29 posts

Hi, Carl.

As you mentioned, FFI looks to be the champion that will unify the various Ruby implementation on one native code interface.

I have beeen trying to get the win32-api to work in Netbeans

Until the port to FFI is complete, you can always roll your own lightweight Win32 adapter, kind of like how the book does. I’d be glad to put together an FFI version of the calls used in the book, if that would be useful to you.

How do you “discover” the container and object names and IDs in Windows and Java apps?

On Windows, my preferred method is to scan C header files matching a certain naming convention (e.g., ..._resource.h) for #include directives, and turn those into C constants. As for figuring out from a GUI what all the elements’ IDs are, Spy++ (which comes with Visual Studio, but there are standalone clones) works well enough.

On the JVM, the Jemmy project has a standalone GUI Browser. A few similar projects exist; I haven’t looked at them in depth.

So should I use JRuby and perhaps JNA or CRuby and see if I can access Java apps from CRuby?

I’d be more inclined to try it in the other direction: use JRuby to access both Java apps (via the built-in Java integration) and native apps (via FFI).

Let me know how it goes!

—Ian

3 posts, 2 voices