Quantifying website loading times using JavaScript code

Looking for a solution to load a webpage, analyze page load time and network call statistics using tools like Selenium. I'm interested in obtaining similar information as Chrome DevTools Network tab, including details on request status, type, size, and timing.

https://i.sstatic.net/wFPph.png

I attempted to use Lighthouse with performance audit configuration but noticed discrepancies between the report generated by Lighthouse and Chrome DevTools Network tab. More information on this issue can be found here.

Are there any JavaScript libraries available that could assist with this task?

Answer №1

Gratitude to @DebanjanB for bringing to my attention that I can acquire read performance data without the necessity of an external library.

let performance = window.performance || window.mozPerformance || window.msPerformance || window.webkitPerformance || {};
let network = performance.getEntries() || {};

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Expanding containers with flexbox to allow for flexibility in size

I need help with a page that contains 3 div elements, where 2 of them need to be resizable. These elements should be able to be moved left or right, and maximized or minimized. You can view the example on Stackblitz. The issue I'm facing is that som ...

What is the method for configuring body attributes in CSS with AngularJS?

Setting the background image of a page using CSS: body { background: url(http://momentumbooks.com.au/wp-content/uploads/2013/06/space.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-backg ...

I need help with creating an AJAX JSON call using Angular. Let me share the JavaScript function that I currently have

When a button is clicked, the function below is called. It retrieves data from a JSON file and stores it if a success message is received. Here is a screenshot of the returned data. My JavaScript function is working correctly, but I am new to Angular and l ...

What is the best way to manage and add dates in my database using Node.JS and MongoDB?

I am currently developing a Calendar application using Node.JS and MongoDB. However, I am encountering difficulties when trying to integrate data from the database into the existing calendar system. Whenever I attempt to load LocalHost:3000/init, I am pre ...

Utilizing Express to load a uniform static website across all website paths

On my express server, I attempted to make all paths load the same static website using this code: const express = require('express'); const app = express(); app.use('*', express.static('build')); app.listen(3000); But every ...

Develop a circular carousel using React JS from scratch, without relying on any third-party library

I am looking to replicate the carousel feature seen on this website. I want to mimic the same functionality without relying on any external libraries. I have found several resources explaining how to achieve this. Most suggest creating duplicate copies o ...

Accessing state property of a different component in ReactJS: A comprehensive guide

I have a main component that incorporates a menu component. The menu component utilizes a state property to store information about the selected menu item. However, I am now faced with the challenge of retrieving the selected module in the main component. ...

Oops! You're trying to perform actions that must be plain objects. If you need to handle async actions

I have been struggling to implement Redux and pass an object into the store. Although I am able to fetch the correct object when I call the action, the store remains unchanged when I use store.dispatch(). It still only reflects the initial state. I've ...

Having issues with Python Selenium's find_elements method not returning the current element for me

Currently in my Python environment, I am using Selenium and implementing a loop to consistently monitor the first child of the row element as it is continuously changing. Strangely though, even when the first child of row changes, the value of the ele va ...

Converting JSON array with ES6 functions

I have a specific array format that needs to undergo transformation. { [ { "condition": "$and", "children": [ { "column": "Title", "comparison": "$eq", "columnValue& ...

What is the best way to eliminate the "driver" instance from the test classes?

Can someone assist me with this question: I am seeking guidance on how to eliminate the instance driver from the BaseTest class while still being able to utilize it in the class and its subclasses? I am currently using POM to construct a testing-framewor ...

The internal style and script specified within the <head> section are not being rendered

Within my Joomla website using the T3 template, I inserted the following "Custom Code" just before the closing </head> tag: <style type="text/stylesheet"> div.t3-sidebar.t3-sidebar-right{ background: #F8F8F8 none repeat scroll 0% 0%; ...

What is the method for breaking a statement within an if statement on Blogger when both the IF and ELSE conditions are met?

I'm making some adjustments to the labels on my blog to ensure that each post has at least two labels. The concept is that if a post has LABEL 1, it will load one script, otherwise it will load another. However, I've encountered a situation wher ...

"Enhancing the Today Button in FullCalendar with Custom Functionality

My issue lies with the implementation of fullCalendar. Specifically, I am utilizing the week view (defaultView: 'basicWeek') with the toolbar buttons for 'today', 'prev', and 'next'. The problem arises when I click t ...

Why is it that Selenium is able to locate a record that remains elusive to me even through debugging?

While working on my App, I have successfully created Selenium tests that can add a new user. However, I am struggling to delete this user from the database. Subsequent tests fail as the username already exists after the initial successful run. Despite se ...

Button cannot be activated upon selecting a row

The goal is to activate a button when a row is selected. However, the button remains disabled even after selecting a row. Below is a snippet of the code as well as a screenshot showing the issue [error_1]: onInit: function () { var oViewMode ...

Unable to convert a Python script (including selenium) into an executable file

Trying to create an executable file from a Python script using pyinstaller. Steps taken: Opened the command prompt in the script's folder Executed the following command: pyinstaller --onefile -w name.py Encountered an error when attempting to open ...

Utilizing async/await functionality within a React-Native component

I'm currently working on implementing a feature that authenticates users before rendering the main 'App' component. However, I'm facing an issue where my code is executing before the promise is resolved. class App extends Component { ...

A script to continuously execute a form action in a loop

As someone transitioning from software development to web development, I find the study of web development quite confusing. Please bear with me as I ask this newbie question. My goal is to test every domain within my array (dMains) so that each domain can ...

What is the best way to refresh a partial view using the Jquery .load() function?

On my page, there is a partial view within the "Attachments" div that I need to reload. I've been trying to achieve this by using the following command: $('#attachments').load('@Url.Action("Attachments" "Transactions",new {id=1297})&a ...