Skip to content

Instantly share code, notes, and snippets.

@c089
c089 / gist:1355195
Created November 10, 2011 15:55
Hover Test
package frontend;
import junit.framework.TestCase;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
@c089
c089 / gist:1370765
Created November 16, 2011 17:35
selenium trunk build failure
Compiling: //java/client/test/org/openqa/selenium/firefox:test_synthesized as build/java/client/test/org/openqa/selenium/firefox/test_synthesized.jar
** Execute //java/client/test/org/openqa/selenium/firefox:test_synthesized
** Execute //java/client/test/org/openqa/selenium/firefox:test_synthesized:run
Testing: //java/client/test/org/openqa/selenium/firefox:test_synthesized
go aborted!
org.apache.tools.ant.BuildException: Test org.openqa.selenium.firefox.SynthesizedFirefoxDriverTestSuite failed
org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java:1863:in `actOnTestResult'
org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java:814:in `execute'
org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java:776:in `execute'
org/apache/tools/ant/UnknownElement.java:291:in `execute'
@c089
c089 / 2.13
Created November 23, 2011 10:58
Selenium / Geb Performance regression example log files
This file has been truncated, but you can view the full file.
11:53:07.282 INFO - Executing: [new session: {platform=ANY, firefox_profile=UEsDBBQACAAIAKNedz8AAAAAAAAAA..., browserName=firefox, version=}] at URL: /session)
11:53:08.649 INFO - Done: /session
11:53:08.661 INFO - Executing: org.openqa.selenium.remote.server.handler.GetSessionCapabilities@7439825d at URL: /session/1322043974417)
11:53:08.661 INFO - Done: /session/1322043974417
11:53:10.021 INFO - Executing: [get: http://10.0.109.126:8080/bad-wc/frottee/handtuecher] at URL: /session/1322043974417/url)
11:53:12.630 INFO - Done: /session/1322043974417/url
11:53:12.717 INFO - Executing: [find element: By.tagName: html] at URL: /session/1322043974417/element)
11:53:12.724 INFO - Done: /session/1322043974417/element
11:53:12.826 INFO - Executing: [find child elements: 0 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@3c563d72, By.selector: div#searchLoadingIndicator] at URL: /session/1322043974417/element/0/elements)
11:53:12.836 INFO - Done: /session/1322043974417/element/0/elements
@c089
c089 / gist:1388862
Created November 23, 2011 14:49
Remote WebDriver IE8 on Windows XP crashing
15:37:02.222 ERROR - Unexpected exception during findElement
org.openqa.selenium.WebDriverException: Error communicating with the remote brow
ser. It may have died.
Build info: version: '2.13.0', revision: '14793', time: '2011-11-18 13:16:47'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.vers
ion: '1.6.0_29'
Driver info: driver.version: EventFiringWebDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.ja
va:412)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDrive
@c089
c089 / ClassWithLogging.groovy
Created December 4, 2011 20:23
Playing around with local transformations
package name.neuroth.playground
import java.lang.annotation.Retention
import java.lang.annotation.Target
import org.codehaus.groovy.transform.GroovyASTTransformationClass
import java.lang.annotation.ElementType
import java.lang.annotation.RetentionPolicy
@Retention(RetentionPolicy.SOURCE)
@Target([ElementType.TYPE])
@GroovyASTTransformationClass(["name.neuroth.playground.ClassWithLoggingASTTransformation"])
@c089
c089 / gist:1505386
Created December 21, 2011 09:33
selenium build failure
org.apache.tools.ant.BuildException: Test org.openqa.selenium.javascript.ClosureTestSuite failed
org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java:1863:in `actOnTestResult'
org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java:814:in `execute'
org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java:776:in `execute'
org/apache/tools/ant/UnknownElement.java:291:in `execute'
sun/reflect/NativeMethodAccessorImpl.java:-2:in `invoke0'
sun/reflect/NativeMethodAccessorImpl.java:39:in `invoke'
sun/reflect/DelegatingMethodAccessorImpl.java:25:in `invoke'
java/lang/reflect/Method.java:597:in `invoke'
org/jruby/javasupport/JavaMethod.java:508:in `invokeDirectWithExceptionHandling'
[java] 2012-03-15 14:56:57,129 (http-bio-0.0.0.0-8080-exec-2) [ ModelScreen:401:ERROR]
[java] ---- runtime exception report --------------------------------------------------
[java] Error rendering screen [component://ecommerce/widget/CommonScreens.xml#main-decorator]: java.lang.NullPointerException: Cannot invoke method getBoolean() on null object. Rolling back transaction.
[java] Exception: java.lang.NullPointerException
[java] Message: Cannot invoke method getBoolean() on null object
[java] ---- stack trace ---------------------------------------------------------------
[java] java.lang.NullPointerException: Cannot invoke method getBoolean() on null object
[java] org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
[java] org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
[java] org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
@c089
c089 / GpxMerge.groovy
Created June 24, 2012 14:08
GPX Merger
// Will write the tracks of all .gpx files in the current working directory
// to /tmp/output.gpx. I used this to bulk import my cardio trainer .gpx files
// into endomondo, because they don't offer bulk import.
// You will have to ensure tha you don't exceed the 10MB limit yourself (I created
// three batches of ~4MB each which seemed to import fine, although I triggered an
// 500 on their side after the import succeeded...
class GpxMerge {
public static void main(String[] args) {
String workingDir = System.getProperty('user.dir')
XmlParser parser = new XmlParser()
@c089
c089 / buster.js
Created July 17, 2012 13:11
Buster exit code is 0 when tests fail
var buster = require('buster');
var config = module.exports;
config['node tests'] = {
environment: 'node',
tests: [ 'fail.js' ]
};
@c089
c089 / browser-fail.js
Created July 17, 2012 14:17
Buster without environment does not execute both groups
buster.testCase('browserfail', {
'it fails in the browser': function() {
assert.isTrue(false);
}
});