Issue with HAR file generation for a page loaded using AJAX

166 views
Skip to first unread message

sum582

unread,
May 1, 2014, 10:09:44 AM5/1/14
to fir...@googlegroups.com
I am trying to  generate HAR files for a selenium Test having 4 steps.The subsequent  pages after the second page is  served by AJAX call. The issue is I am getting only 2 HAR files. For  the pages loaded with AJAX calls i am not getting  any HAR file generated. If i see FireBug in the browser (manual testing) I can see the data for each of the steps.

I  am using Selenium Web Driver+FireBug+NetExport.

Can someone please help on this?  Is  FireBug+NetExport  with Selenium not supported for rich applications?




                               DesiredCapabilities capabilities = new DesiredCapabilities();
FirefoxProfile profile = new FirefoxProfile();
profile.addExtension(new File("firebug-1.12.8.xpi"));
profile.addExtension(new File("netExport-0.9b2.xpi"));
profile.setPreference("extensions.firebug.defaultPanelName", "net");
profile.setPreference("extensions.firebug.net.enableSites", true);
profile.setPreference("extensions.firebug.allPagesActivation", "on");
profile.setPreference("extensions.firebug.netexport.defaultLogDir", "d:\\NetExport\\");
profile.setPreference("extensions.firebug.netexport.saveFiles", true);
profile.setPreference("extensions.firebug.netexport.alwaysEnableAutoExport", true);
profile.setPreference("extensions.firebug.netexport.showPreview", false);
profile.setPreference("extensions.netexport.pageLoadedTimeout", "15000");
capabilities.setCapability(FirefoxDriver.PROFILE, profile);
                                WebDriver driver = new FirefoxDriver(capabilities);
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
Thread.sleep(5000); 

Thread.sleep(15000);
driver.findElement(By.id("j_username::content")).sendKeys("sysman");
driver.findElement(By.id("j_password::content")).sendKeys("sysman");
driver.findElement(By.id("login")).click();
Thread.sleep(5000);
driver.findElement(By.xpath("//tr[@id='ccc']/td[2]")).click();
Thread.sleep(5000);
driver.findElement(By.id("zaapq")).click();
                               Thread.sleep(5000);
driver.quit();

sum582

unread,
May 6, 2014, 12:57:39 AM5/6/14
to fir...@googlegroups.com
can someone please help on this?

Jan Honza Odvarko

unread,
May 6, 2014, 5:48:30 AM5/6/14
to fir...@googlegroups.com
> profile.addExtension(new File("netExport-0.9b2.xpi"));
Note that the latest netExport version is 0.9b4
https://getfirebug.com/releases/netexport/


Honza

sum582

unread,
May 6, 2014, 6:30:31 AM5/6/14
to fir...@googlegroups.com
problem remains even with the latest version of net export(0.9b4)


On Thursday, May 1, 2014 7:39:44 PM UTC+5:30, sum582 wrote:

Jan Honza Odvarko

unread,
May 6, 2014, 6:38:31 AM5/6/14
to fir...@googlegroups.com


On Tuesday, May 6, 2014 12:30:31 PM UTC+2, sum582 wrote:
problem remains even with the latest version of net export(0.9b4)
I see, so I guess what you need is:
https://code.google.com/p/fbug/issues/detail?id=5971

Honza




 

sum582

unread,
May 6, 2014, 8:48:28 AM5/6/14
to fir...@googlegroups.com
I created the XPI with patch and it worked fine. Thanks for your help. There is one issue though, I dont want any  har file to be created until i request it through that java script call. But  i am getting the HAR file for each file load in addition to the HAR file which i requested through javascript call.

I have set
             profile.setPreference("extensions.firebug.netexport.timeout", "0");
             profile.setPreference("extensions.netexport.pageLoadedTimeout", "0");

any fix for this?

On Thursday, May 1, 2014 7:39:44 PM UTC+5:30, sum582 wrote:

Jan Honza Odvarko

unread,
May 6, 2014, 9:08:39 AM5/6/14
to fir...@googlegroups.com
Please follow the thread under
https://code.google.com/p/fbug/issues/detail?id=5971

Honza
Reply all
Reply to author
Forward
0 new messages