Skip to content

Instantly share code, notes, and snippets.

View hugs's full-sized avatar
🤖
Making robots

Jason Huggins hugs

🤖
Making robots
View GitHub Profile
@hugs
hugs / COPYING
Created November 21, 2009 23:00
Screentest Demo
Copyright (c) 2009 Jason R. Huggins
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
@hugs
hugs / Python IE WebDriver bindings
Created January 5, 2010 21:31
Python IE WebDriver bindings
Windows XP
[09:46] ~ $java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
[09:59] ~ $ruby --version
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
[09:59] ~ $python --version
Python 2.6.4
C:\projects\selenium-miki\build\lib>python webdriver\ie_tests\api_examples.py
...................F......E.EE.
======================================================================
ERROR: testScreenshot (webdriver.common_tests.api_examples.ApiExampleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\projects\selenium-miki\build\lib\webdriver\common_tests\api_examples.py", line 45, in tes
tMethod
return func(self)
File "C:\projects\selenium-miki\build\lib\webdriver\common_tests\api_examples.py", line 277, in te
@hugs
hugs / Chrome WebDriver Python test results
Created January 11, 2010 22:59
Chrome WebDriver Python test results
C:\projects\selenium-miki2>set PYTHONPATH=c:\projects\selenium-miki2\build\lib
C:\projects\selenium-miki2>cd build\lib
C:\projects\selenium-miki2\build\lib>ls
webdriver
C:\projects\selenium-miki2\build\lib>python webdriver\chrome_tests\api_examples.py
Traceback (most recent call last):
File "webdriver\chrome_tests\api_examples.py", line 24, in <module>
@hugs
hugs / Killing popup dialogs in Firefox
Created January 12, 2010 06:19
Killing popup dialogs in Firefox
// 1) Install Firebug
// 2) In a new browser window, open this URL:
// chrome://global/content/commonDialog.xul
// (It doesn't matter the particular .xul file you open, as long as it is a valid XUL file.)
// 3) Launch JavaScript Shell in Firebug
// 4) In the new shell window, type the following commands:
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
@hugs
hugs / Selenium IDE - Test Execution Workflow
Created January 12, 2010 23:47
Selenium IDE - Test Execution Workflow
Selenium IDE - Test Execution Workflow:
*) Launch Selenium IDE
*) Load/open a test case file. (Left as an excercise for the reader.)
*) Press the green play button. Tool-tip reads "Play current test case". Under the hood, its id is 'play-button'.
*) Which calls "cmd_selenium_play"
@hugs
hugs / LICENSE
Created February 15, 2010 01:45
The Node.js "Hello World" web server ported to CoffeeScript
I, Jason Huggins, the author of the work "CoffeeScript Web Server" (2010), irrevocably renounce
all current and future legal rights to the work in any medium whatsoever.
I stand behind the merit of the work, but disclaim all liability for it under law.
I encourage you, the audience, to share, copy, distribute, perform, remix, mash up, interpret,
excerpt, translate, and otherwise enjoy and use the work as you will.
I request that you acknowledge my authorship.
@hugs
hugs / but_does_it_scale.txt
Created February 15, 2010 03:15
CoffeeScript + Node = Highly Caffeinated Web Server Scripting
# CoffeeScript + Node = Highly Caffeinated Web Server Scripting
# Code: http://gist.github.com/304374#file_webserver.coffee
#
# Measured on a MacBook Pro (OS X 10.5.8, 3.06 GHz Intel Core 2 Duo, 4 GB 1067 MHz DDR3)
hugs:~ hugs$ ab -n 1000 -c 10 http://127.0.0.1:8000/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
@hugs
hugs / virtualenv.txt
Created February 24, 2010 06:04
Installing and Using virtualenv -- It's easy!
# Install virtualenv
sudo pip install virtualenv
# Create the virtual environment
virtualenv sandbox
# Play around with Python inside the new 'sandbox'
cd sandbox
./bin/python
cd ..
@hugs
hugs / build_test_install.txt
Created February 26, 2010 15:39
Selenium 2 Build - Ubuntu 9.10 - Python 2.6
# Get recent updates
$ sudo apt-get update upgrade
$ sudo apt-get upgrade
# Install some decent tools :-)
$ sudo apt-get install vim ack-grep
# Install pre-reqs
$ sudo apt-get install sun-java6-jdk ruby rake subversion python-pip python2.6-dev
$ sudo pip install distribute py