How to extract network tab contents of firefox and IE Developer tools using selenium

2,077 views
Skip to first unread message

satish gowda

unread,
Nov 9, 2016, 9:06:34 PM11/9/16
to Selenium Users
I am trying to extract the network calls of firefox and IE developer tools via selenium webdriver using json, Is there is any other json format available to extract the network tab contents

⇜Krishnan Mahadevan⇝

unread,
Nov 10, 2016, 1:27:05 AM11/10/16
to Selenium Users
You should be using a proxy server such as BrowserMob Proxy [ https://github.com/lightbody/browsermob-proxy ]

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Thu, Nov 10, 2016 at 7:36 AM, satish gowda <satish...@gmail.com> wrote:
I am trying to extract the network calls of firefox and IE developer tools via selenium webdriver using json, Is there is any other json format available to extract the network tab contents

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/8804c404-8db8-47d5-ae02-dd3a14080fe6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

hembhar

unread,
Nov 10, 2016, 11:50:05 AM11/10/16
to Selenium Users
For firefox, you can try using -

firebug-2.0.14.xpi,netExport-0.9b3.xpi

Provide the firefox preferences: profile.setPreference("extensions.firebug.defaultPanelName", "net");
profile.setPreference("extensions.firebug.netFilterCategories", "js");

Set log export preference : 
profile.setPreference("extensions.firebug.netexport.saveAs", "test.har");
profile.setPreference("extensions.firebug.netexport.defaultLogDir", "C:\\BrowserLogs");

Regards,
Bharat.P

satish gowda

unread,
Nov 10, 2016, 1:39:12 PM11/10/16
to Selenium Users
@Krishan 

I am not able to capture network traffic data from Office laptop, but the same program using browsermob-proxy working in my Personal laptop
could you tell how to resolve this problem in office laptop

i do use below lines to configure to our proxy setting
seleniumProxy.setHttpProxy("localhost:8181");
seleniumProxy.setSslProxy("trustAllSSLCertificates");

below is the code that i used
BrowserMobProxy proxy = new BrowserMobProxyServer();
proxy.start(0);

    // get the Selenium proxy object
    System.out.println(proxy.getServerBindAddress());
    Proxy seleniumProxy = ClientUtil.createSeleniumProxy(proxy);
    seleniumProxy.setHttpProxy("localhost:8181");
    seleniumProxy.setSslProxy("trustAllSSLCertificates");
    // configure it as a desired capability
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(CapabilityType.PROXY, seleniumProxy);

    // start the browser up
    WebDriver driver = new ChromeDriver(capabilities);

    // enable more detailed HAR capture, if desired (see CaptureType for the complete list)

// proxy.enableHarCaptureTypes(CaptureType.REQUEST_CONTENT, CaptureType.RESPONSE_CONTENT);

    // create a new HAR with the label "yahoo.com"
    proxy.newHar("google.com");

    // open yahoo.com
    driver.get("https://www.google.com");

    // get the HAR data
    Har har = proxy.getHar();
    System.out.println(har);
    try {
		har.writeTo(new FileOutputStream("text.txt"));
	} catch (FileNotFoundException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

could you tell how to resolve this issue 

On Thursday, November 10, 2016 at 12:27:05 AM UTC-6, Krishnan wrote:
You should be using a proxy server such as BrowserMob Proxy [ https://github.com/lightbody/browsermob-proxy ]

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Thu, Nov 10, 2016 at 7:36 AM, satish gowda <satish...@gmail.com> wrote:
I am trying to extract the network calls of firefox and IE developer tools via selenium webdriver using json, Is there is any other json format available to extract the network tab contents

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

satish gowda

unread,
Nov 10, 2016, 1:42:34 PM11/10/16
to Selenium Users
@Bharat

I was working with selenium 2.53 and Firefox 47 version with "netExport-0.9b7.xpi" and firebug version "firebug-2.0.17-fx.xpi" it was working fine to capture network traffic into HAR file
now with new version selenium 3.0.1 and firefox version 49 and i am using "netExport-0.9b7.xpi" and firebug version "firebug-2.0.18-fx.xpi" it is not working fine

I am not able to generate with new version of Selenium and Firefox
could you please check on this

i referred https://eveningsamurai.wordpress.com/2013/06/29/capturing-network-traffic-using-selenium-webdriverfirebug/


as of now it will not work newer version of Selenium and Firefox , could you tell me how to do with newer version 

Reply all
Reply to author
Forward
0 new messages