I have test written on C# with Selenium Webdriver. now i need testing performance of application. i used FiddlerCore but it doesn't have page rendering time or time of dynamiс content(ajax,js and etc.).
Anybody know library like FiddlerCore but with more features like dynatrace Ajax edition or browsermob-proxy for C#?
EDIT 1: I don't need any solutions. I want to test with WebDriver only.
I've created performace test use BrowserMob as following
- Download lastest BrowserMob: http://bmp.lightbody.net/
- Get AutomatedTestter.BrowserMob from https://github.com/AutomatedTester/AutomatedTester.BrowserMob
- Get Selenium
- Run following code:
// Supply the path to the Browsermob Proxy batch file
Server server =
new Server(
@"path\to\browsermob-proxy.bat");
server.Start();
Client client = server.CreateProxy();
client.RemapHost("host", "ip address");
client.NewHar("google");
var seleniumProxy = new Proxy { HttpProxy = client.SeleniumProxy };
var profile = new FirefoxProfile();
profile.SetProxyPreferences(seleniumProxy);
// Navigate to the page to retrieve performance stats for
var driver = new FirefoxDriver(profile);
driver.Navigate().GoToUrl("http://google.com.vn");
// Get the performance stats
HarResult harData = client.GetHar();
AutomatedTester.BrowserMob.HAR.Log log = harData.Log;
AutomatedTester.BrowserMob.HAR.Entry[] entries = log.Entries;
foreach (var entry in entries)
{
AutomatedTester.BrowserMob.HAR.Request request = entry.Request;
var url = request.Url;
var time = entry.Time;
Console.WriteLine("Url: " + url + " - Time: " + time);
}
driver.Quit();
client.Close();
server.Stop();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With