5

I am writing selenium test scripts using c#. I need to do this on IE11.

I am trying to do below: 1. Navigate to a page 2. When this page is loading, browser makes an API request 3. I want to capture this API request and then examine its content through code.

Is there a way to proxy request - response and retrieve its parameters within Selenium webdriver script?

I need to use C# for this.

Dilip Agheda
  • 1,719
  • 1
  • 9
  • 15
  • Possible duplicate of [How to get HTTP Response Code using Selenium WebDriver](https://stackoverflow.com/questions/6509628/how-to-get-http-response-code-using-selenium-webdriver) – Todor Minakov Jan 22 '19 at 05:03
  • That's possible in Chrome, with some flags - look at the linked question, more specifically the answers with "Network.enable" (currently the 2nd by votes), and "--remote-debugging-port" (just a few votes). – Todor Minakov Jan 22 '19 at 05:06
  • @TodorMinakov sorry i should have mentioned in my question. i need solution on IE11. – Dilip Agheda Jan 22 '19 at 05:36
  • 1
    This is where I would start off - intercepting the `XMLHttpRequest` requests, through javascript; look at this question - https://stackoverflow.com/questions/25335648/how-to-intercept-all-ajax-requests-made-by-different-js-libraries. – Todor Minakov Jan 22 '19 at 05:41

0 Answers0