Introduction
Robot Framework can be executed on the .NET platform with IronPython.
NOTE:
Starting from Robot Framework 2.7 installation
using IronPython is officially supported.
Instructions on this page explain how to install earlier versions.
Robot Framework 2.6 - 2.6.2 do not support IronPython due to
problems explained in issue 917 . These problem have been fixed in
Robot Framework 2.6.3.
Installation
Preconditions
- Install .NET Framework. We have only tested with the 4.0 series, but earlier and newer versions should work too assuming you can install IronPython on them.
- Install IronPython. We have tested with 2.6.2 and 2.7 releases but possible newer 2.6.x and 2.7.x releases ought to work too.
- Install the source distribution of elementtree module. We have only tested with the 1.2.7 preview release, which should have better IronPython support than 1.2.6. See Installing Python modules section below for installation instructions.
- If you are using IronPython 2.6.x with Robot Framework 2.6.3 or newer, install IronPython.Zlib module. This module is included into IronPython 2.7 so separate installation is not needed with that release.
- Optionally, you can add IronPython installation directory into PATH to ease running ipy.exe from the command line.
Installing Python modules
- Get and extract the source distribution package of the module you want to install. Alternatively you may be able to checkout the source code directly from the project's version control.
- Go to the extracted or checked out directory from the command line.
- Install the module with command ipy setup.py install. If you do not have ipy in PATH, you need to use a full path to it. With IronPython 2.6.x you also need to add --no-compile option like in ipy setup.py install --no-compile.
Robot Framework
- Get the source code either as downloading a source distribution or by doing a checkout.
- See Installing Python modules section above for installation instructions.
Running tests
Start-up script
Robot Framework installation creates pybot.bat start-up script into <IronPythonInstallation>\Scripts directory. You can execute the script by using a full path to it or add the directory into PATH. If you do the latter, you may also want to rename the script to ipybot.bat to avoid a clash with the normal pybot start-up script.
Execution
If you have renamed the script to ipybot.bat and have it in PATH, you can run tests simply with:
ipybot path/to/tests.txt
Future enhancements
The main enhancements needed to support .NET better are:
- Better installation support to create ipybot script automatically ( issue 480 )
- Support for writing test libraries with C# (issue 721)
For .NET test library support, an alternative using remote library approach is available, http://code.google.com/p/sharprobotremoteserver/
On a side note, if we use IronPython? to call .NET code, would it also be possible to write and use .NET libraries created in other languages like VB.NET, etc.? Since they all talk through the CLR. Though we know C# is more preferable and popular outside the VB/Microsoft community.
Created a page on my blog --> http://tips-testing.blogspot.in/2012/04/robotframework-with-ironpython-csharp.html
Thanks, Palani