VBA code migration - Is Possible?

Ask general questions here.
thangavel
Posts: 50
Joined: Tue Jun 09, 2009 6:48 am
Contact:

VBA code migration - Is Possible?

Post by thangavel » Tue Apr 16, 2013 6:37 am

Hi,

We are using both Ranorex and TestPartner (Microfocus). We would like to migrate TestPartner scripts into Ranorex scripts. Technically what is the possibilities available for this migration. TestPartner uses VBA coding.
Regards,
Thangavel.S

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: VBA code migration - Is Possible?

Post by Aracknid » Tue Apr 16, 2013 4:04 pm

I was using TestPartner for about 7 years before I switched to Ranorex. I had (actual still have) a huge TP framework and thousands of tests.

I'm not sure how you created your TestPartner scripts, but if you hand coded them using all VBA code (didn't using VisualTest part of TestPartner), then I assume you'll be hand coding your scripts in Ranorex using VisualStudio and the Ranorex API? Anyway, that's what I did.

If you use Visual Studio and VB.NET coding, all you have to do is copy and paste code from TP into VS and then manually clean it up. There are some parts of my TP frame work which required no changes at all and worked as pasted. Other required some small tweaks. And then there were other parts that required complete re-writes. It really depends on what you have. For example, all the old code I had to access databases using ADO was replaced with .NET dataproviders.

It's important to realize that some old VBA code can work as written in VB.NET but there are newer and better ways to write the code. Does this mean you have to do this? That's up to you to decide.

Is there a way to automatically change the code? I did not look into this. I had heard from a developer in my company that it was possible but that you would spend as much time cleaning up the auto-generated code, since it was not perfect. Also, you need to take into account that this is a good opportunity to re-evaluate what you have and to redesign and improve what you have in TP.

Anyway, we are still migrating our code from TP to Ranorex, and have been for many months now. I don't expect this to be done any time soon. I told my boss it would take about 1 - 2 years (on top of all the other work we have to do), and we made a roadmap and planned it all out.

Good luck.

thangavel
Posts: 50
Joined: Tue Jun 09, 2009 6:48 am
Contact:

Re: VBA code migration - Is Possible?

Post by thangavel » Tue Apr 16, 2013 4:47 pm

Thanks for your valuable information!

For Ranorex, I use VS2010 with c# coding.
For TP I use decriptive programming (All VBA Code). I never used Visual Test.

It seems there is no complete migration at all. We need to re-write the code (If I want to migrate it to c#). How to clean auto-generated code?
Regards,
Thangavel.S

Bretanark
Posts: 1
Joined: Tue Jul 16, 2013 6:58 am

Re: VBA code migration - Is Possible?

Post by Bretanark » Tue Jul 16, 2013 7:12 am

I've just started on an automated migration project from TestPartner to VB.NET based on a similar project I did converting Rational Robot to C#.

I turned the scripts into VB6 code with stub (Robot/TestPartner) functions and constants to make it compile. I then converted this using VB2008's upgrade wizard and then implemented the underlying UI automation for the stubbed methods. I used SharpDevelop to convert from VB.NEt to C#. In between each third-party conversion, I wrote my own code to prepare / cleanup the generated code.

For about 1000 test scripts, which took 2 machine-weeks to run, this process took about 6 months, which is a huge saving over Rational Robot and TestPartner's licensing for 20 test machines. The result required only Visual Studio licensing (e.g. VS express, which is free) and could therefore be accessed by developers, which dramatically streamlined defect resolution.

I'd be happy to discuss more about how this could be done by emailing [email protected]