Skip to content

Commit

Permalink
Updated libraries and zap 2.6 version
Browse files Browse the repository at this point in the history
  • Loading branch information
continuumsecurity committed Jun 17, 2017
1 parent 47860fc commit 8cc9e65
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 248 deletions.
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ task buildIt() {
}

test {
testLogging {
exceptionFormat = 'full'
}
systemProperties = System.properties
dependsOn assemble, compileTestJava, cleanReports
finalizedBy(generateReportTask)
Expand Down Expand Up @@ -112,8 +115,8 @@ dependencies {
testCompile 'org.glassfish.jersey.media:jersey-media-moxy:2.25.1'
testCompile 'junit:junit-dep:4.11'
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile ('org.seleniumhq.selenium:selenium-java:2.53.1') { exclude group: 'junit' }
testCompile 'org.seleniumhq.selenium:selenium-api:2.53.1'
testCompile ('org.seleniumhq.selenium:selenium-java:3.4.0') { exclude group: 'junit' }
testCompile 'org.seleniumhq.selenium:selenium-api:3.4.0'
testCompile 'log4j:log4j:1.2.17'
testCompile 'args4j:args4j:2.0.16'
testCompile 'commons-configuration:commons-configuration:1.8'
Expand Down
Binary file modified lib/zap-java-api-2.6.0.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.continuumsecurity.behaviour.INavigable;
import net.continuumsecurity.web.WebApplication;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

public class RopeyTasksApplication extends WebApplication implements ILogin,
ILogout,INavigable {
Expand Down Expand Up @@ -69,7 +70,8 @@ public void search(String query) {
findAndWaitForElement(By.linkText("Tasks")).click();
driver.findElement(By.id("q")).clear();
driver.findElement(By.id("q")).sendKeys(query);
driver.findElement(By.id("search")).click();
WebElement searchBtn = driver.findElement(By.name("search-button"));
searchBtn.click();
}

public void viewAllUsers() {
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/net/continuumsecurity/scanner/ZapManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public int startZAP(String zapPath) throws Exception {
File zapProgramFile = new File(zapPath);
port = findOpenPortOnAllLocalInterfaces();
List<String> params = new ArrayList<>();
params.add(zapProgramFile.getAbsolutePath()); params.add("-daemon");
params.add(zapProgramFile.getAbsolutePath());
params.add("-daemon");
params.add( "-host"); params.add( HOST);
params.add("-port"); params.add(String.valueOf(port));
params.add("-dir"); params.add("tmp");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ public void setAttackStrength(String strength) {
throw new RuntimeException("First set the scanning policy before setting attack strength or alert threshold");
for (String id : scannerIds.split(",")) {
getScanner().setScannerAttackStrength(id, strength.toUpperCase());

}
}

Expand Down Expand Up @@ -361,7 +362,7 @@ public void theApplicationIsSpidered() {
try {
getContext().setIncludeInContext(ZAP_CONTEXT_NAME, ".*"); //if URLs are not in context then they won't be spidered
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
getSpider().setMaxDepth(10);
getSpider().setThreadCount(10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,12 @@ private WebDriver createDriver(String type) {
}

private WebDriver createHtmlUnitDriver(DesiredCapabilities capabilities) {
if (capabilities != null) return new HtmlUnitDriver(capabilities);
if (capabilities != null) {
capabilities.setBrowserName("htmlunit");
return new HtmlUnitDriver(capabilities);
}
capabilities = new DesiredCapabilities();
capabilities.setBrowserName("htmlunit");
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
return new HtmlUnitDriver(capabilities);
}
Expand Down
68 changes: 0 additions & 68 deletions zap/README

This file was deleted.

Loading

0 comments on commit 8cc9e65

Please sign in to comment.