Error in reading HAR file

340 views
Skip to first unread message

gsoun...@gmail.com

unread,
Feb 15, 2013, 12:07:53 PM2/15/13
to http-archive-...@googlegroups.com
I'm using Browser mob proxy to get HAR file. But hte file has 'Missing timings field in entries element' error. I know that latest build will still work even if the HAR file has error but it wasn't working in my case. I'm not sure what is going wrong in my code.

I face this problem even with the test HAR file which is available in the build ('missing-timing.har'). Can anyone help me to resolve it?




                                       File f = new File("C:\\missing-timing.har");
//Traversing through log entries to get Omniture data
       HarFileReader r = new HarFileReader();
   
  
     // All violations of the specification generate warnings
     List<HarWarning> warnings = new ArrayList<HarWarning>();
     HarLog l = r.readHarFile(f, warnings);
     for (HarWarning w : warnings)
       System.out.println("File: cnbc.com.har" + " - Warning:" + w);
     HarLog log = r.readHarFile(f);
   HarEntries entries = log.getEntries();
   List <HarEntry> entry = entries.getEntries();
   //Capturing Omniture data in a array list
   ArrayList<String> OmniData = new ArrayList <String>();    
   for(HarEntry ent : entry)
   {
    HarRequest Req = ent.getRequest();
    HarResponse Res = ent.getResponse();
    HarQueryString R = Req.getQueryString();
    HarCookies Respon = Res.getCookies();
    List<HarQueryParam> list1 = R.getQueryParams();
    List<HarCookie> Cook = Respon.getCookies();    
    for(HarCookie Cookie : Cook)
    {    
    String HARLogs = Cookie.getDomain();
    if(HARLogs!=null)
    {
    if((HARLogs.equalsIgnoreCase(".nbcuni.com")))
    {    
    for(HarQueryParam Param : list1)
    {
    System.out.println(Param.getName());
    System.out.println(Param.getValue());        
    }

Emmanuel Cecchet

unread,
Feb 18, 2013, 8:59:42 AM2/18/13
to http-archive-...@googlegroups.com, gsoun...@gmail.com
Hi,

Can you post the exact error that you are getting?
Note that browsermob proxy usually generates compliant files but if it gets too many errors or the HAR is retrieved before the page has fully loaded, it might have more structural issues that will prevent the parsing.
In your case though, make sure you don't have an older version of the lib somewhere in your classpath. But it's hard to tell until we know what exact error you are getting.

Emmanuel
--
--
You received this message because you are subscribed to the Google
Groups "HTTP Archive Specification" group.
To post to this group, send email to
http-archive-...@googlegroups.com
To unsubscribe from this group, send email to
http-archive-specif...@googlegroups.com
For more options, visit this group at
https://groups.google.com/forum/#!forum/http-archive-specification
 
---
You received this message because you are subscribed to the Google Groups "HTTP Archive Specification" group.
To unsubscribe from this group and stop receiving emails from it, send an email to http-archive-specif...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

gsoun...@gmail.com

unread,
Feb 19, 2013, 11:46:17 AM2/19/13
to http-archive-...@googlegroups.com, gsoun...@gmail.com
Thanks for your help.

I had both old and new version in my build path. I removed the older version and now it works smooth.

Thanks,
Gnana

For more options, visit this group at
https://groups.google.com/forum/#!forum/http-archive-specification
 
---
You received this message because you are subscribed to the Google Groups "HTTP Archive Specification" group.
To unsubscribe from this group and stop receiving emails from it, send an email to http-archive-specification+unsub...@googlegroups.com.

satish gowda

unread,
Sep 21, 2016, 1:12:19 AM9/21/16
to HTTP Archive Specification
Hi can you complete the above code where you are retrieving the value  query string parameter ,
here i also looking to read the values of query string parameter  from Har file

Thanks
Reply all
Reply to author
Forward
0 new messages