I have a problem with Zap plugin in Jenkins. Assume I have my selenium script wrriten in java , it will launch a browser and set a proxy automatically. What I need is to launch selenium java code from Jenkins, and use the zap plugin to open the zap proxy and generate report.
The process in Jenkins should be : 1. start ZAP proxy as pre-build, 2. Execute Selenium java code (which will go through the ZAP proxy automatically) 3. ZAP generate report and send back to Jenkins. 4. Shut down ZAP proxy.
My confusion is when I use the zap plugin in Jenkins, there is a starting point URL which is mandatory. But I don't want an active scanning, I only need a passive scanning from what go through the zap proxy by selenium script. Is there a way to walk around it? Any advise on this would be helpful.
Please find my sample selenium java script below:
public class Sample_ZapProgram {
public static void main(String[] args) throws InterruptedException {
WebDriver driver;
Proxy proxy = new Proxy();
// proxy.setHttpProxy("localhost:8090");
proxy.setFtpProxy("localhost:8090");
proxy.setSslProxy("localhost:8090");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.PROXY, proxy);
System.setProperty("webdriver.chrome.driver","C:\\Users\\Administrator\\workspace\\chromedriver.exe");
driver = new ChromeDriver(capabilities);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get("http://demo.testfire.net/");
Thread.sleep(15000);
driver.quit();
//tearDown();
}
}