I'm using Robot/python to test a large C/C++ Unix server application. It's much better than the previous pile of home-brew perl. I've used four different techniques to integrate C with Robot, here's the rundown from my experience:
1. Communicating over sockets works very well. Python is a great language to write TCP test clients. If your product has a TCP-based interface, using Robot/Python to test that will be a pleasure. Just be sure to use python ssl.SSLContext() if you want to test SSL/TLS properly.
2. Running CLIs is somewhat problematic because Robot inherits issues from Python. When running a CLI in a test framework, you really want all three of: 1. ability to provide input to CLI from Robot, 2. ability to accept arbitrary sized output data from CLI, 3. ability to have timeout that aborts the CLI. The Robot Process module does not do all three. This can't be done without using Python 3's subprocess communicate() method or writing that functionality in python 2 (I did the latter because we can't upgrade our infrastructure to Python 3 yet). Anyway, this is the worst problem I've encountered using Robot/Python and was solvable.
3. Python's ctypes module works well for integrating C APIs directly into Robot (as long as you keep your API types clean and simple). So if your server has shared libraries, it's not hard to turn them into Robot keywords. However, be aware that your python binary architecture must match your shared library architecture (e.g., 32-bit vs. 64-bit). If you don't have sufficient control over your python binaries, this integration technique won't work.
4. A final option for integrating C code into Robot is to use the remote library interface. It took me a few days to write an XML RPC server daemon in C so I could do this. It's a bit cumbersome to add new keywords to the C daemon, but the interface runs much faster than a CLI and the ability to gather C debugging and route it to the robot log works nicely.
- Chris
(speaking for myself only)
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.