Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I found Web browsers provides information that could be somehow useful for a tester/dev:

  • HAR (HTTP ARchive) files that can be later viewed with HAR viewers.
  • cURL command, e.g., here is what I got when doing "Copy as cURL" for this web page:

    curl 'http://sqa.stackexchange.com/' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Host: sqa.stackexchange.com' -H 'Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4' -H 'User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8' -H 'Referer: http://sqa.stackexchange.com/' -H 'Cookie: __qca=P0-1782664706-1363204143275; sgt=id=372cfe23-66cf-4686-bd71-3fd115e4f32a; __utma=27693923.46027841.1363204138.1379233083.1379250315.372; __utmb=27693923.15.10.1379250315; __utmc=27693923; __utmz=27693923.1375130388.204.7.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); sqauser=t=WZvUS8s6IEWP&s=T2hKXHEgzkC7' -H 'Connection: keep-alive' -H 'If-Modified-Since: Sun, 15 Sep 2013 13:46:59 GMT' --compressed

I usually include URLs, HTTP requests and responses (whole, or only header or body with JSON). So I wonder if cURL and HAR are better than that and if so, then how. Particularly:

  1. Does it make sense to attach them to a bug report? In what problems they can be useful?
  2. How cURL command is better from simple URL or JSON request to reproduce the issue? Did cURL help you isolate any defect or understand the problem better than HTTP Request? It seems to me to be the same, just sending a request from command line seems more straightforward.
  3. Is HAR file useful only to understand performance problems? If so, then how? If no, then also how?
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

In what problems they can be useful?

cURL's output is the HTTP response, so I think they're equivalent. You might choose to capture the output with cURL if capturing via the browser requires a lot of typing and clicking.

How cURL command is better from simple URL or JSON request to reproduce the issue? Did cURL help you isolate any defect or understand the problem better than HTTP Request? It seems to me to be the same, just sending a request from command line seems more straightforward.

I agree.

Is HAR file useful only to understand performance problems? If so, then how? If no, then also how?

The HAR captures traffic going in both directions, i.e. the requests and the responses. If your developers or testers believe that reproducing a problem requires specifying things to that level of detail (e.g. instead of instructions in terms of clicking and typing), then the HAR is a good way to go. It's easy enough to read them as regular text files, and there are fancy viewers for them too.

share|improve this answer
    
Can HAR be used to reproduce the traffic again? I.e. trigger requests? Or it can be used only to read what happened? –  dzieciou Sep 15 '13 at 18:27
2  
Googling for "replaying a HAR" should answer that question. –  user246 Sep 15 '13 at 19:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.