Example #1
0
        public void LocalGameTest()
        {
            var fileName = "LocalGameTest.csv";

            DateTime unix          = new DateTime(1970, 1, 1);
            var      unixTimestamp = DateTime.UtcNow;

            _webDriver.Navigate().GoToUrl("file:///D:/selenium%20projekt/BrowserBenchmark/BrowsersBenchmark/Resources/Game.html");

            var navigationTimeStamp = (long)WebTimeService.NavigationStart(_webDriver);
            var navigationDateTime  = unix.AddMilliseconds(navigationTimeStamp);

            var navigationStart  = (navigationDateTime - unixTimestamp).TotalMilliseconds;
            var requestTime      = WebTimeService.RequestTime(_webDriver);
            var responseTime     = WebTimeService.ResponseTime(_webDriver);
            var wholeRequestTime = WebTimeService.WholeRequestTime(_webDriver);
            var domRenderingTime = WebTimeService.DomRenderingTime(_webDriver);
            var pageLoadTime     = WebTimeService.PageLoadTime(_webDriver);

            var content = $"{_webDriverName};{navigationStart};{requestTime};{responseTime};{wholeRequestTime};{domRenderingTime};{pageLoadTime}";

            AddToFile(fileName, content);
        }
Example #2
0
        public void ExternalWebSiteTest()
        {
            var fileName = "ExternalWebSiteTest.csv";

            DateTime unix          = new DateTime(1970, 1, 1);
            var      unixTimestamp = DateTime.UtcNow;

            _webDriver.Navigate().GoToUrl(@"https://www.onet.pl/");

            var navigationTimeStamp = (long)WebTimeService.NavigationStart(_webDriver);
            var navigationDateTime  = unix.AddMilliseconds(navigationTimeStamp);

            var navigationStart  = (navigationDateTime - unixTimestamp).TotalMilliseconds;
            var requestTime      = WebTimeService.RequestTime(_webDriver);
            var responseTime     = WebTimeService.ResponseTime(_webDriver);
            var wholeRequestTime = WebTimeService.WholeRequestTime(_webDriver);
            var domRenderingTime = WebTimeService.DomRenderingTime(_webDriver);
            var pageLoadTime     = WebTimeService.PageLoadTime(_webDriver);

            var content = $"{_webDriverName};{navigationStart};{requestTime};{responseTime};{wholeRequestTime};{domRenderingTime};{pageLoadTime}";

            AddToFile(fileName, content);
        }