Sunday, November 11, 2012

Selenium WebDriver with Python in Ubuntu

I use Selenium WebDriver all day writing Acceptance tests in C# for a .NET based web application. In my own time, I'm also taking a look at using WebDriver with Python.

I blogged a while back about using WebDriver to log into Gmail and send an e-mail. This is a simplified version of that, simply logging into Gmail, as this will get the point across.

First, we need to install a couple of packages on our Ubuntu system to get started:

sudo apt-get install python-pip

And then...

sudo pip install selenium

Now, we are all set to write our test using Selenium WebDriver and the unittest framework:



This should create the following output when ran:


Now, just for reference, here is the same functional test written in C#


Thanks to Corey Coldberg for the instructions to get me started!
Enjoy, and happy coding!

No comments:

Post a Comment