add firefox profile support.  Some machines need it to get around extensions 
that get in the way


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f8cccea0
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f8cccea0
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f8cccea0

Branch: refs/heads/tlf
Commit: f8cccea06c2f9613c4fa970050860c413a82ada2
Parents: c596b16
Author: Alex Harui <aha...@apache.org>
Authored: Fri Jun 9 12:09:32 2017 -0700
Committer: Alex Harui <aha...@apache.org>
Committed: Fri Jun 9 12:09:32 2017 -0700

----------------------------------------------------------------------
 mustella/java/src/marmotinni/MarmotinniRunner.java | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f8cccea0/mustella/java/src/marmotinni/MarmotinniRunner.java
----------------------------------------------------------------------
diff --git a/mustella/java/src/marmotinni/MarmotinniRunner.java 
b/mustella/java/src/marmotinni/MarmotinniRunner.java
index a2f85e4..73061fd 100644
--- a/mustella/java/src/marmotinni/MarmotinniRunner.java
+++ b/mustella/java/src/marmotinni/MarmotinniRunner.java
@@ -24,6 +24,8 @@ import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.firefox.FirefoxDriver;
 import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.firefox.FirefoxProfile;
+import org.openqa.selenium.firefox.internal.ProfilesIni;
 
 import java.io.IOException;
 import java.nio.CharBuffer;
@@ -214,6 +216,13 @@ public class MarmotinniRunner extends DefaultHandler {
         WebDriver driver;
                if (browser != null && browser.equalsIgnoreCase("chrome"))
                        driver = new ChromeDriver();
+               else if (argsMap.containsKey("profile"))
+               {
+                       ProfilesIni profile = new ProfilesIni();
+                       FirefoxProfile ffprofile = 
profile.getProfile(argsMap.get("profile"));
+                       System.out.println("FireFox Profile: " + 
argsMap.get("profile"));                       
+                       driver = new FirefoxDriver(ffprofile);
+               }
                else
                        driver = new FirefoxDriver();
                

Reply via email to