title: Failing at Logging HTTP Requests for testing file download
body: <p>I am trying to replicate this:</p>
  
  <p><a href="https://devexpress.github.io/testcafe/documentation/test-api/intercepting-http-requests/" rel="nofollow noreferrer">https://devexpress.github.io/testcafe/documentation/test-api/intercepting-http-requests/</a></p>
  
  <p>My target page has <code>target="_blank"</code> is there a way how to change the attribute removing this <code>target</code>?</p>
  
  <p>So the test fails.</p>
  
  <p>It is not very clear what the code in the example does. Does URL have to be of the page where the download link is present?</p>
  
  <pre><code>import { ClientFunction, t, Selector, RequestLogger } from 'testcafe'
  import * as fs from 'fs';
  import * as path from 'path';
  ...
  const forInvoice = new ForInvoice()
  const client = 'STRV s.r.o.'
  
  const url = urlFor('?/timers/unbilledOverview')
  const logger = RequestLogger({ url, method: 'post' }, {
  logResponseHeaders: true,
  logResponseBody:    true
  });
  
  fixture.only `For Invoicing`
     .requestHooks(logger);
  
  test('Verify download of .xls and .pdf', async t =&gt; {
      await t.useRole(ADMIN_INVOICE)
      await forInvoice.navigateToForInvoicing()
      await forInvoice.filterClient(client)
      await t
          .click(Selector('a').filter('.sc-mini-icon-file.excel-file'))
          .expect(logger.contains(r =&gt; r.response.statusCode === 200)).ok();
  
      const filePath = path.join(__dirname, 'STRV-s-r-o-Attachment');
  
      console.log(filePath);
      console.log(logger.requests[0].response.headers);
  
      fs.writeFileSync(filePath, logger.requests[0].response.body);
  
  })
  </code></pre>