Skip to content

Instantly share code, notes, and snippets.

@stackedsax
Created March 31, 2012 03:32
Show Gist options
  • Save stackedsax/2258986 to your computer and use it in GitHub Desktop.
Save stackedsax/2258986 to your computer and use it in GitHub Desktop.
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 ){
+ appData = new File(MessageFormat.format("{0}\\Mozilla\\Firefox", "C:\\WINDOWS\\system32\\config\\systemprofile\\Application Data"));
+ } else {
+ appData = new File(MessageFormat.format("{0}\\Mozilla\\Firefox", System.getenv("APPDATA")));
+ }
break;
case MAC:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment