Skip to content

Instantly share code, notes, and snippets.

{
"capabilities":
[
{
"browserName": "firefox",
"platform": "WINDOWS",
"version": "3.6",
"firefox_binary": "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
"seleniumProtocol": "Selenium",
"maxInstances": 6
Perhaps this:
[sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method),
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39),
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27),
java.lang.reflect.Constructor.newInstance(Constructor.java:513),
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:147),
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:113),
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:397),
@stackedsax
stackedsax / error_msg_without_version_via_grid.log
Created November 8, 2011 12:18
My grid/node version question
Exception in thread "main" org.openqa.selenium.WebDriverException:
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.6.6', java.version: '1.6.0_26'
Driver info: driver.version: RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:131)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:105)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:409)
@stackedsax
stackedsax / example.json
Created January 9, 2012 18:31
Example android configuration
{
"capabilities":
[
{
"browserName": "android",
"platform": "ANDROID",
"seleniumProtocol": "WebDriver",
"maxInstances": 1,
"port": 80
}
@stackedsax
stackedsax / config.json
Created January 10, 2012 07:05
Example Android config
{
"capabilities":
[
{
"browserName": "android",
"platform": "ANDROID",
"seleniumProtocol": "WebDriver",
"maxInstances": 1,
"port": 8081
}
@stackedsax
stackedsax / optimizeFirefoxSqlite.bat
Created January 28, 2012 04:39
Batch file for optimizing the sqlite files in your Firefox profiles
:: This assumes all your various firefox profiles are within your %USERPROFILE% directory
for /f "delims==" %%a in (' dir "%USERPROFILE%\places.sqlite" /s/b ') do echo delete from moz_places where hidden=1 and url like 'http%%';|"sqlite3.exe" "%%a"
for /f "delims==" %%a in (' dir "%USERPROFILE%\*.sqlite" /s/b ') do echo vacuum;|"sqlite3.exe" "%%a"
With this in my code:
capability.setCapability(FirefoxDriver.PROFILE, "Firefox8");
I see this occur on the VM:
09:07:06.564 INFO - Executing: [new session: {platform=WINDOWS, firefox_profile=Firefox8, firefox_binary=C:\Program Files\Mozilla Fire..., browserName=firefox, version=4.0}] at URL: /session)
but even though firefox_profile=Firefox8, the Firefox8 profile is not used.
@stackedsax
stackedsax / ProfilesIni.java
Created March 31, 2012 03:32
Proof that the APPDATA env variable is null
Index: java/client/src/org/openqa/selenium/firefox/internal/ProfilesIni.java
===================================================================
--- java/client/src/org/openqa/selenium/firefox/internal/ProfilesIni.java (revision 16421)
+++ java/client/src/org/openqa/selenium/firefox/internal/ProfilesIni.java (working copy)
@@ -134,7 +134,11 @@
case WINDOWS:
case VISTA:
case XP:
- appData = new File(MessageFormat.format("{0}\\Mozilla\\Firefox", System.getenv("APPDATA")));
+ if (System.getenv("APPDATA") == null ){
@stackedsax
stackedsax / FirefoxDriver.java
Created March 31, 2012 09:56
Provides a way to load a locally-stored Firefox profile and maintains the ability to send a profile as a json string
Index: java/client/src/org/openqa/selenium/firefox/FirefoxDriver.java
===================================================================
--- java/client/src/org/openqa/selenium/firefox/FirefoxDriver.java (revision 16421)
+++ java/client/src/org/openqa/selenium/firefox/FirefoxDriver.java (working copy)
@@ -101,10 +101,13 @@
if (raw instanceof FirefoxProfile) {
profile = (FirefoxProfile) raw;
} else if (raw instanceof String) {
- try {
- profile = FirefoxProfile.fromJson((String) raw);
@stackedsax
stackedsax / selenium2test.java
Created April 2, 2012 20:47
Loading firebug and yslow
package com.yahoo.media.mediaqa.selenium2test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.android.AndroidDriver;
import org.openqa.selenium.firefox.*;
import org.openqa.selenium.firefox.internal.ProfilesIni;