I have been trying to write C# code to output the network tab contents of Developer tools as JSONArray, this is what I have so far:
*IWebDriver driver = new ChromeDriver(@"C:\Users\xxx\Downloads\chromedriver_win32");
driver.Navigate().GoToUrl("https://google.com");
String scriptToExecute = "var performance = window.performance || window.mozPerformance || window.msPerformance || window.webkitPerformance || {}; var network = performance.getEntries() || {}; return network;";
String netData = ((IJavaScriptExecutor)driver).ExecuteScript(scriptToExecute).ToString();
Console.WriteLine(netData);*
And the other:
*IWebDriver driver = new ChromeDriver(@"C:\Users\xxx\Downloads\chromedriver_win32");
driver.Navigate().GoToUrl("https://google.com");
String ste = "Return window.performance.getEntries();";
String Timings = ((IJavaScriptExecutor)driver).ExecuteScript(ste).ToString();
Console.WriteLine(Timings);*
But my output is not giving the expected result. It looks like the String netData variable is returning as empty, thinking it is an issue with the Script. Any suggestions on a workaround for this?