Get it on github.
Author Archive
Run Selenium Cases Through A Web Interface
By Anthony in Python, QA, Selenium, Snippets, Test Automation, TestingI’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.
Nose print bug fixed
By Anthony in ProgrammingI 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
Python Credit Card Generator
By Anthony in Snippetsfrom 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 [...]
Run concurrent processes
By Anthony in Snippetsimport 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."
Giant List of Data Models
By Anthony in Data ModelsI was searching for a list of common data models for picka. What I came across was this monster listing.
Twitter your build status with Twildbot.
By Anthony in Python, QA, SnippetsThis is a tiny script which will get the current status of your build, and tweet it to your twitter account.
Adding JQuery Locators to Selenium
By Anthony in Selenium, Snippets, Test Automation, TestingIt’s very simple to add jquery functionality to your selenium installation, and also very useful if you use the functions a lot.
Selenium on the cloud, with Amazon EC2
By Anthony in WritingI 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’.


