Python for Test Automation

Until recently I hadn’t paid much attention to the Python programming language. Let me get to my point quickly: I have become a big fan of Python. Python is a scripting language and at first glance it looks and feels quite similar to Perl. Python was created in the early 1990s but it has really taken off lately, driven in part by its use at Google where it is one of their main languages. Python is also used extensively at Industrial Light and Magic, Disney Animation Studios, and NASA. There are many online articles and blogs you can find which attempt to quantify in some way why Python is good, or better than some other language(s), but for me it boil down to the "does it feel right" criterion. And when I’m coding with Python, it just feels right. But what about Python for test automation? I don’t have deep enough knowledge or experience to state a strong opinion, but from what I’ve seen so far, I think Python would make an excellent choice as a language for almost all types of test automation programs. When writing test automation in a Windows environment, typical tasks include unit/API testing (so you need to be able to access functions in a DLL file), UI automation (so you need to be able to access the Windows API set), network-related testing (so you need sockets), Web request-response testing (so you need HTTP methods), Web UI testing (so you need to be able to access the Internet Explorer DOM), SQL-related testing (so you need to be able to connect to databases), and XML-related tasks (so you need XML parsers and other tools). As far as I can tell, Python has excellent libraries for all of these tasks with the minor exception of being able to access the IE DOM directly (although you can get at the IE DOM through its COM interface) .

This entry was posted in Software Test Automation. Bookmark the permalink.