Author Archive

August 3, 2010 0

Selenium-Python Textmate Bundle

By Anthony in Programming

Get it on github.

July 28, 2010 0

Run Selenium Cases Through A Web Interface

By Anthony in Python, QA, Selenium, Snippets, Test Automation, Testing

I’ve heard a couple of people ask how to run Selenium test cases through a web interface with python. Here is how you do it.

July 20, 2010 0

Nose print bug fixed

By Anthony in Programming

I fixed the nose print bug, where the first run of a test with a print statement would pass but any run thereafter would fail. Get the fix here: http://github.com/antlong/nose

July 20, 2010 0

Python Credit Card Generator

By Anthony in Snippets

from random import Random import copy generator = Random() generator.seed() def creditcard(type=""): def credit_card_number(generator, prefixList, length): def _completed_number(prefix, length): ccnumber = prefix while len(ccnumber) < (length – 1): digit = generator.choice(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']) ccnumber.append(digit) sum, pos = (0, 0) reversedCCnumber = [] reversedCCnumber.extend(ccnumber) reversedCCnumber.reverse() while pos < length [...]

July 20, 2010 0

Run concurrent processes

By Anthony in Snippets

import signal import subprocess, os signal.alarm(5) def oh_crap(*args): def _inner(*a): for pid in args: print "Killing %d" % pid os.kill(pid, signal.SIGKILL) return _inner p1 = subprocess.Popen(["/usr/bin/python", "alarmer.py"]) p2 = subprocess.Popen(["/usr/bin/python", "alarmer.py"]) signal.signal(signal.SIGALRM, oh_crap(p1.pid, p2.pid)) pid, sts = os.waitpid(p1.pid, 0) pid, sts = os.waitpid(p2.pid, 0) print "Done."

July 19, 2010 0

Giant List of Data Models

By Anthony in Data Models

I was searching for a list of common data models for picka. What I came across was this monster listing.

July 16, 2010 0

The Strain

By Anthony in Reading
July 16, 2010 0

Twitter your build status with Twildbot.

By Anthony in Python, QA, Snippets

This is a tiny script which will get the current status of your build, and tweet it to your twitter account.

July 15, 2010 0

Adding JQuery Locators to Selenium

By Anthony in Selenium, Snippets, Test Automation, Testing

It’s very simple to add jquery functionality to your selenium installation, and also very useful if you use the functions a lot.

July 13, 2010 0

Selenium on the cloud, with Amazon EC2

By Anthony in Writing

I am currently writing a doc which aims to provide directions, analysis and benefits of using selenium in the cloud, with Amazon’s EC2. Included in the write-up, is Boto vs. Twisted Amazon. Essentially they are the same, the main difference being, Boto is ‘blocking’ while TxAWS is ‘non-blocking’.