File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/main/java/com/frameworkium/config/drivers Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 33import com .frameworkium .config .DriverType ;
44import org .openqa .selenium .WebDriver ;
55import org .openqa .selenium .firefox .FirefoxDriver ;
6+ import org .openqa .selenium .firefox .FirefoxProfile ;
67import org .openqa .selenium .firefox .internal .ProfilesIni ;
78import org .openqa .selenium .remote .DesiredCapabilities ;
89
10+ import java .io .File ;
11+
912import static com .frameworkium .config .SystemProperty .FIREFOX_PROFILE ;
1013
1114public class FirefoxImpl extends DriverType {
@@ -18,7 +21,15 @@ public DesiredCapabilities getDesiredCapabilities() {
1821 @ Override
1922 public WebDriver getWebDriverObject (DesiredCapabilities capabilities ) {
2023 if (FIREFOX_PROFILE .isSpecified ()) {
21- return new FirefoxDriver (new ProfilesIni ().getProfile (FIREFOX_PROFILE .getValue ()));
24+ File profileFile = new File (FIREFOX_PROFILE .getValue ());
25+ FirefoxProfile firefoxProfile ;
26+ if (profileFile .isFile () && !profileFile .isDirectory ()) {
27+ firefoxProfile = new FirefoxProfile (profileFile );
28+ }
29+ else {
30+ firefoxProfile = new ProfilesIni ().getProfile (FIREFOX_PROFILE .getValue ());
31+ }
32+ return new FirefoxDriver (firefoxProfile );
2233 }
2334 else {
2435 return new FirefoxDriver (capabilities );
You can’t perform that action at this time.
0 commit comments