Skip to content

Instantly share code, notes, and snippets.

View davehunt's full-sized avatar

Dave Hunt davehunt

View GitHub Profile
@davehunt
davehunt / gist:1099645
Created July 22, 2011 15:12
Create a virtual environment if one doesn't already exist - for CI builds
if [ -d ".env" ]; then
echo "**> virtualenv exists"
else
echo "**> creating virtualenv"
virtualenv --no-site-packages .env
fi
// PREFS.JS
/**
* Retrieve the value of the homepage preference
*
* @memberOf prefs
* @param {Boolean|Number|String|Object} [aDefaultValue]
* Default value which will be used if the preference doesn't exist.
* @param {PrefBranch} [aBranch]
* Preferences branch to use.
Index: java/server/src/org/openqa/selenium/server/SeleniumDriverResourceHandler.java
===================================================================
--- java/server/src/org/openqa/selenium/server/SeleniumDriverResourceHandler.java (revision 14055)
+++ java/server/src/org/openqa/selenium/server/SeleniumDriverResourceHandler.java (working copy)
@@ -624,6 +624,9 @@
|| SeleniumCoreCommand.CAPTURE_ENTIRE_PAGE_SCREENSHOT_ID.equals(cmd)) {
return "Got result: [base64 encoded PNG] on session " + sessionId;
}
+ if (SeleniumCoreCommand.GET_HTML_SOURCE_ID.equals(cmd)) {
+ return "Got result: [HTML source] on session " + sessionId;
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
driver = webdriver.Firefox(firefox_binary=FirefoxBinary('/Applications/Firefox 7.app/Contents/MacOS/firefox-bin'))
driver.get('http://input.mozilla.com/')
driver.find_element_by_id('show-custom-date').click()
driver.find_element_by_id('id_date_start').click() # should pop up a datepicker
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<hudson.model.ChoiceParameterDefinition>
<name>PLATFORM</name>
@davehunt
davehunt / build.log
Created November 17, 2011 14:12
Logs from Selenium session issue in 2.12.0
Started by timer
Building on master
Checkout:workspace / /Users/Shared/Jenkins/Home/jobs/mdn.staging/workspace - hudson.remoting.LocalChannel@5ea47962
Using strategy: Default
Last Built Revision: Revision 14384a8d45f03d4f76934cec602b3514cfcd9502 (origin/HEAD, origin/master)
Checkout:workspace / /Users/Shared/Jenkins/Home/jobs/mdn.staging/workspace - hudson.remoting.LocalChannel@5ea47962
Wiping out workspace first.
Cloning the remote Git repository
Cloning repository origin
Fetching upstream changes from git://github.com/mozilla/mdn-tests.git
Dave-Hunts-iMac:workspace dave$ git clone [email protected]:mozilla/mcom-tests.git mcom-tests-temp
Cloning into mcom-tests-temp...
remote: Counting objects: 434, done.
remote: Compressing objects: 100% (162/162), done.
remote: Total 434 (delta 293), reused 402 (delta 261)
Receiving objects: 100% (434/434), 79.38 KiB, done.
Resolving deltas: 100% (293/293), done.
Dave-Hunts-iMac:workspace dave$ cd mcom-tests-temp/
Dave-Hunts-iMac:mcom-tests-temp dave$ git push origin master:temp
Total 0 (delta 0), reused 0 (delta 0)
@davehunt
davehunt / build.log
Created November 28, 2011 15:01
Logs from Selenium timeout issue in r14922
Building on master Checkout:workspace / /Users/Shared/Jenkins/Home/jobs/mdn.staging/workspace - hudson.remoting.LocalChannel@6f76dd71 Using strategy: Default Last Built Revision: Revision 14384a8d45f03d4f76934cec602b3514cfcd9502 (origin/HEAD, origin/master) Checkout:workspace / /Users/Shared/Jenkins/Home/jobs/mdn.staging/workspace - hudson.remoting.LocalChannel@6f76dd71 Fetching changes from 1 remote Git repository Fetching upstream changes from git://github.com/mozilla/mdn-tests.git Seen branch in repository origin/HEAD Seen branch in repository origin/m Seen branch in repository origin/master Seen branch in repository origin/staging Commencing build of Revision 14384a8d45f03d4f76934cec602b3514cfcd9502 (origin/HEAD, origin/master) Checking out Revision 14384a8d45f03d4f76934cec602b3514cfcd9502 (origin/HEAD, origin/master) Warning : There are multiple branch changesets here [EnvInject] - Injecting as environment variables the properties content 'PATH=.env/bin:/usr/bin:/bin:/usr/sbin:/sbin' [workspace] $ /bin/s
2011-11-28 21:11:25
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.4-b02-402 mixed mode):
"Thread-82" daemon prio=5 tid=102b21800 nid=0x10c204000 runnable [10c203000]
java.lang.Thread.State: RUNNABLE
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:198)
at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:218)
at org.apache.commons.exec.StreamPumper.run(StreamPumper.java:105)
at java.lang.Thread.run(Thread.java:680)
@davehunt
davehunt / README.md
Created December 1, 2011 13:27
pytest issue 93 example test case

install required python modules

sudo pip install pytest pytest-xdist selenium

download selenium server

curl http://selenium.googlecode.com/files/selenium-server-standalone-2.14.0.jar -o selenium-server-standalone-2.14.0.jar