Skip to content

Instantly share code, notes, and snippets.

View AutomatedTester's full-sized avatar

David Burns AutomatedTester

View GitHub Profile
'''
Script for working out the amount of time till GTAC
'''
__author__ = 'David Burns'
def whenIsGtac():
from datetime import datetime
now = datetime.now()
print 'You have ' + str(datetime(year=2009,month=10,day=21,hour=7,minute=00) - now) + ' time left till GTAC! \nBut you have ' + str(datetime(year=2009,month=10,day=19,hour=7,minute=00) - now) + ' till your slides have to be in! \nStop being so lazy!!!'
Selenium.prototype.doStoreStuff(data,varName){
//do stuff here or just go straight to storing
storedVars[varName] = data;
}
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
# Using Selenium 2 and its native Python bindings for the first time...
# On Ubuntu 8.04 and Python 2.5.2
"""
# Checkout
$ svn checkout http://selenium.googlecode.com/svn/trunk/ webdriver
# Build the code
$ cd webdriver
$ sudo python setup.py build
Please share this as much as you want and add to it even!
<h2>Unfortunately the page you were after can not be found. Perhaps you can spend a few minutes helping find some missing people.</h2>
<script type="text/javascript">
var statecode = "ZZ";
$.getJSON("http://query.yahooapis.com/v1/public/yql?q=SELECt+*+From+xml+Where+url%3D'http%3A%2F%2Fuk.missingkids.com%2Fmissingkids%2Fservlet%2FXmlServlet%3Fact%3Drss%26LanguageCountry%3Den_GB%26orgPrefix%3DUK02'&format=json&callback=?",
function(data){
leng = data.query.results.rss.channel.item.length;
items = data.query.results.rss.channel.item;
for(i=0;i<leng;i++){
$(".missingkid").append("<img src=" + items[i].enclosure.url + "> <br /> " + items[i].description + "<br/>");
}
C:\selenium>go //firefox:test:run
(in C:/selenium)
No srcs specified for selenium-core
Compiling: //common:test as build\common\test.jar
Compiling: //remote/common:test as build\remote\common\test.jar
Compiling: //remote/client:test as build\remote\client\test.jar
Compiling: //firefox:test as build\firefox\test.jar
Testing: //firefox:test
E, [2010-07-22T11:37:09.939000 #2508] ERROR -- : Error instantiating 'junit' tas
k: org.apache.tools.ant.BuildException: Test org.openqa.selenium.firefox.Firefox
C:\selenium>java -jar third_party\jruby\jruby-complete-1.5.0.RC2.jar -S gem list
*** LOCAL GEMS ***
Antwrap (0.7.0)
columnize (0.3.1)
hoe (2.6.0)
json_pure (1.4.2)
rake (0.8.7)
@AutomatedTester
AutomatedTester / Output
Created December 13, 2010 16:28
Ruby tests output
David-Burnss-MacBook-Pro:selenium davidburns$ ./go //rb:firefox-test:jruby
(in /development/selenium)
No Gecko sdk detected. Install xulrunner-dev to compile 64-bit Firefox extension.No srcs specified for selenium-core
Using iPhoneSDK: 'iphonesimulator4.1'
Preparing: //rb:common in build/rb
Preparing: //rb:remote in build/rb
Falling back to copy of: firefox/prebuilt/Win32/Release/webdriver-firefox.dll
Preparing: //firefox:webdriver as build/firefox/webdriver.xpi
Preparing: //rb:firefox in build/rb
Running: firefox ruby tests (jruby)
@AutomatedTester
AutomatedTester / startChrome.js
Created February 9, 2011 12:21
Starts Google Chrome
var util = require('util'),
exec = require('child_process').exec,
child;
child = exec('open "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"',
function (error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);