Owasp Zap cannot able to capture transactions via remote dirver (Firefox)

51 views
Skip to first unread message

Praveen Kumar

unread,
Aug 10, 2021, 12:56:48 PM8/10/21
to OWASP ZAP Developer Group
Dear Team,

I am completely new to the Owasp Zap.

I have integrated my application with Owasp Zap, but the problem is Owasp zap cannot able to capture the transactions of the selenium test cases through the remote driver.

But the same works fine with physical/desktop chrome driver.exe.

Below are the configurations used for the mozilla remote driver,
--------------------xxxxxxxxxx-------------xxxxxxxxxxxx----------------------------
 DesiredCapabilities capabilities = new DesiredCapabilities();
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("network.proxy.type", "manual");
profile.setPreference("network.proxy.http", "127.0.0.1");
profile.setPreference("network.proxy.http_port", ZAP_PROXYPORT);
capabilities.setCapability(FirefoxDriver.PROFILE, profile);
WebDriver webDriver = new RemoteWebDriver(new                                        URL("http://127.0.0.1:4444/wd/hub"), capabilities);
webDriver.manage().window().setSize(new Dimension(1920, 1080));
----------------xxxxxxxxxxxx---------------xxxxxxxxxxxxxx----------------------------------

Kindly also let me know if any configuration is available for the remote chrome driver, which is much preferable for my use case

Many thanks for the help!!

kingthorin+owaspzap

unread,
Aug 10, 2021, 2:01:08 PM8/10/21
to OWASP ZAP Developer Group
If you're using a modern version of Firefox you have to configure the prefs further to proxy loopback (localhost) traffic.

Praveen Kumar

unread,
Aug 10, 2021, 5:27:19 PM8/10/21
to OWASP ZAP Developer Group
Thanks for the quick reply.

Even after the above-mentioned configuration, selenium test cases transactions via remote driver aren't able to capture in Owasp Zap.

DesiredCapabilities capabilities = new DesiredCapabilities();
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("network.proxy.type", "manual");
profile.setPreference("network.proxy.http", "127.0.0.1");
profile.setPreference("network.proxy.http_port", ZAP_PROXYPORT);
profile.setPreference("network.proxy.allow_hijacking_localhost", true);

capabilities.setCapability(FirefoxDriver.PROFILE, profile);
WebDriver webDriver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capabilities);
webDriver.manage().window().setSize(new Dimension(1920, 1080));

kingthorin+owaspzap

unread,
Aug 10, 2021, 9:49:11 PM8/10/21
to OWASP ZAP Developer Group
Reply all
Reply to author
Forward
0 new messages