Skip to content

Commit

Permalink
Merge pull request #99 from continuumsecurity/drivers
Browse files Browse the repository at this point in the history
Drivers
  • Loading branch information
viktorKhan authored Aug 8, 2018
2 parents 83acfe3 + 6d69c5d commit 095a594
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public void verifyProtocolHttps() {

@Given("the HTTP request-response containing the login form")
public void findResponseWithLoginform() throws UnsupportedEncodingException {
String regex = "(?i)input[\\s\\w=:'-\"]*type\\s*=\\s*['\"]password['\"]";
String regex = "(?i)input[\\s\\w=:'\\-\\\"]*type\\s*=\\s*['\\\"]password['\\\"]";
List<HarEntry> responses = getProxy().getHistory();
responses = getProxy().findInResponseHistory(regex);
if (responses == null || responses.size() == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.GeckoDriverService;
import org.openqa.selenium.firefox.internal.ProfilesIni;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
Expand Down Expand Up @@ -107,9 +108,9 @@ private WebDriver createDriver(String type) {
throw new RuntimeException("Unsupported WebDriver browser: "+type);
}
private WebDriver createProxyDriver(String type) {
if (type.equalsIgnoreCase(CHROME)) return createChromeDriver(createProxyCapabilities(type));
else if (type.equalsIgnoreCase(FIREFOX)) return createFirefoxDriver(createProxyCapabilities(type));
else if (type.equalsIgnoreCase(HTMLUNIT)) return createHtmlUnitDriver(createProxyCapabilities(type));
if (type.equalsIgnoreCase(CHROME)) return createChromeDriver(createProxyCapabilities(CHROME));
else if (type.equalsIgnoreCase(FIREFOX)) return createFirefoxDriver(createProxyCapabilities(FIREFOX));
else if (type.equalsIgnoreCase(HTMLUNIT)) return createHtmlUnitDriver(createProxyCapabilities(HTMLUNIT));
throw new RuntimeException("Unsupported WebDriver browser: "+type);
}

Expand Down Expand Up @@ -158,6 +159,7 @@ public WebDriver createFirefoxDriver(DesiredCapabilities capabilities) {
capabilities = new DesiredCapabilities();
}
capabilities.setCapability(FirefoxDriver.PROFILE, myProfile);
System.setProperty("webdriver.gecko.driver", Config.getInstance().getDefaultDriverPath());
return new FirefoxDriver(capabilities);
}

Expand Down

0 comments on commit 095a594

Please sign in to comment.