C# to automate a Java application with JavaAccessBridge?

Hi all,

I'm stuck on what appears to be quite a niche problem. I've got a Java application that I want to automate, tasks and some testing etc, but this only registers as a SunAWTFrame, hence no controls are exposed to typical tools for getting this job done.

I knew this was going to be tricky, and my search has lead me to C# and somehow utilising Java access bridge dlls in a c# program to automate it.

Has anyone had any experience of this?

Oracle provides JavaAccessBridge (JAB) with some dlls to help with this as I understand it after reading a few articles around the internet. There are some code examples but I'm really not groking it right now. By breaking it down, I think this is what needs to be achieved:

1 – Import / load / parse the JAB dlls

2 – Map functions in the JAB dll to methods / calls within my program

3 – Have the Java application to automate run (with JAB enabled) and get handle of it to my program

4 – Utilise the JAB functions to control the Java application

Now, I don't know C# as well as I know Java (and that may be an initial hurdle for me) but that's not going to stop me.

If anyone can provide help, guidance, pointers or anything to get me started, that'd be truly awesome.

by mcorrigal via /r/csharp

Leave a Reply