Page 1 of 1

Using Ranorex with Python

Posted: Fri Nov 04, 2011 3:41 pm
by jtruppia
I've seen some old posts about this, but nothing newer than 2008.
Is it still possible to use Ranorex with Python? Using IronPython maybe? That should work, cause it uses the CLI, right? Any code examples available?

Re: Using Ranorex with Python

Posted: Mon Nov 07, 2011 12:39 pm
by Support Team
Hi,

please have a look at following forum post:
http://www.ranorex.com/forum/sooo-what- ... tml#p10238

Regards,
Tobias
Support Team

Re: Using Ranorex with Python

Posted: Mon Nov 07, 2011 4:40 pm
by jtruppia
Thanks, it's a shame cause Python is such a good language to do scripting, really useful for testing.
For anyone who ends up here, it might be useful to know that I'm currently using Ranorex 3.0.5 and IronPython 2.7.1 with success. However, I don't use Ranorex Studio, only the Spy and its generated code (IronPython code, please don't take that out!!!) and Visual Studio (with PVST, Python Visual Studio Tools) and it works (there are some things with IntelliSense, but that's more a PVST bug)

I have one question left, is there a way to do in Python something similar to what the following code does in C#

Code: Select all

Ranorex.Button but = "<RanorexPath to the button>"

Re: Using Ranorex with Python

Posted: Mon Nov 07, 2011 5:26 pm
by Support Team
jtruppia wrote:Thanks, it's a shame cause Python is such a good language to do scripting, really useful for testing.
As I wrote in the other forum thread, you can still use IronPython with Ranorex. It's just that the Ranorex tools won't generate IronPython code any more. However, you can still create assemblies containing repositories and recordings in C# or VB and then use them in your IronPython code.
jtruppia wrote:only the Spy and its generated code (IronPython code, please don't take that out!!!)
I'm really sorry, but we have already removed that functionality with Ranorex 3.1, since it was not working reliably with all Ranorex features. Just can still just create your repository in C#, compile it to a DLL and use that DLL from IronPython.
jtruppia wrote:I have one question left, is there a way to do in Python something similar to what the following code does in C#
Python does not have explicit variable declarations, but you can do the following:
form = Ranorex.Form("/form[@title='Calculator']")
Regards,
Alex
Ranorex Team