For front-end developers and testers, finding and fixing bugs in the web app can be tough sometimes because of unexpected data from the API call and uncertain user interactions. All modern browsers have a developer tool to debug errors in the code.
**Extract text from JSON data with our powerful and easy-to-use online free tool. Get the data you need quickly and efficiently, no technical skills required. **
Google Chrome, one of the most popular browsers, also has built-in developer tools called Chrome Developer Tools. This article will guide you on using Chrome developer tools for debugging and testing web applications.
Chrome Developer Tools or Chrome DevTools is a set of web development tools built into the Google Chrome browser that lets us inspect, edit, and debug our code and measure our page’s performance. These tools let developers see the changes on web pages in real time, diagnose problems more quickly, and build a better website. Explore 25 Best Debugging Tools for 2023, which will help you debug seamlessly.
To access the Chrome developer tools, developers may use the following three methods:
The easiest one is using keyboard shortcuts i.e. Ctrl + Shift + J in Windows and cmd + Option + J in Mac.
Open the browser menu by clicking on the three dots in the upper right corner, scroll down to the More tools option, and select the Developer tools option.
Right-click on the web page to debug and click on the Inspect option.
As you can see in the above image, the Chrome debugger has nine panels. All these panels are responsible for different debugging tasks. Here is a quick summary of what each panel is mainly responsible for.
Elements: It can inspect and edit HTML elements and CSS style attributes.
Network: Responsible for viewing and debugging network-related activities.
Performance: Used to analyze the web page load speed and optimization.
Memory: Assists in tracking memory usage and fixing memory-related issues.
Application: It inspects cookies, localStorage, sessionStorage, IndexDB, and any other local database.
Security: Used to debug certificates and other security problems.
Lighthouse: It audits the web app/website’s SEO, performance, quality, accessibility, etc.
Let’s have a detailed look at all these nine panels in detail.
**JSON Validator is a free and easy-to-use tool to validate JSON data, which makes it easier to fix the issue by providing error line and character position. **
The elements panel lets developers inspect and modify the HTML and CSS of the web page. With the elements panel, we can modify the code directly in the browser and see those changes instantly reflected on the web page.
Developers and testers mainly use the elements panel to experiment with the HTML structure or the web page’s design. Its features include a color picker, responsive screen sizes, CSS editor, layout analyzer, animation builder, event listeners, and rulers.
To inspect and modify any component we need to select that using the selection tool icon on the top right corner or by pressing Ctrl + Shift + C or Cmd + Shift + C as a shortcut. This will display the HTML/Document Object Model (DOM) and CSS for that component in the elements panel. Next, we can modify the HTML or CSS for that component. Any changes we make will be immediately reflected on the page and will not affect the source file directly.
*Don’t waste time debugging your YAML files. Use our free YAML validator tool to validate your YAML code quickly and identify syntax errors and fix them. *
This permits real-time examination of variable values using the Chrome developer tools’ console panel. Developers and testers may put various console.log() statements in their code and then see their output in the console panel as the user interacts with the browser.
As shown in the image above, the sources panel has three primary components.
In the center, the Code Editor pane displays all the source codes for the files selected from the File Navigator.
The network panel is mainly used to detect any upload or download request made by the webpage using the network. We can log and analyze all network activity in the log section.
To analyze the web app’s network performance using the Chrome Developer’s tool we can open the network panel by clicking on the Network tab. Next, we may clear all previous logs by clicking on the clear icon. Finally, we can refresh our web page to get the network log and real time waterfall graph of the website.
The network panel is used to monitor the number of requests made by a web page, total data transferred, loading time taken, resources downloaded or uploaded, caching performance, and other network-related activities. This information helps developers and testers to optimize individual resources and the web app.
The performance panel in Chrome DevTools allows developers and testers to measure the page load performance of a web app. This is achieved by running a performance analysis on the web page and generating metrics on various aspects of the page load process, like the time taken by the web page to display, various network resources to load, and the web page to be interactive. To open the performance panel, we can click on the performance tab on the Chrome developer tools.
The record and reload page button in the performance panel of Chrome DevTools allows developers and testers to run performance analysis on a web page and view detailed metrics about how the page is rendering and loading. By clicking the reload button, the tool will simulate a user visiting and interacting with the web page, providing information about the page load process in graphs and screenshots.
Detailed performance analysis on the LambdaTest website is shown below.
We can even interact with call stacks and check functions that may consume more time, block the main thread, and delay the TTI (Time To Interactive) metric. Selecting a function provides all kinds of information for that function. We can check how long that function was executed and what other functions it called, and we can also open the function in the *sources *panel.
*Minify your JS code without changing its functionality with our easy-to-use JS Minifier that reduces the size of your scripts and improve website speed. *
The memory panel in Chrome developer tools provides advanced insight into the web page’s memory consumption. We can inspect memory usage by component, snapshot heap allocation, and record allocation timelines.
The memory panel detects and fixes memory-related issues like leaks, bloats, and garbage collections. To open the memory panel, we can click on the memory tab on the Chrome developer tools.
The Chrome DevTools memory panel allows us to select from three profiling types.
**Allocation instrumentation on time
**The Allocation Sampling view maps memory consumption for individual page components like frames, documents, web workers, and graphics layers. This profiling type indicates the source of any high memory consumption.
The application panel in Chrome developer tools is used to inspect and edit the manifest file, service worker, cookies, localDB, sessionStorage, and other local databases. This panel is also used to view the website’s metadata, protocols, and icons.
To open the application panel, click on the Application tab in the Chrome DevTools.
The application panel is mainly helpful in inspecting the progressive web apps that use local storage and API. This helps developers and testers manage storage, caches, and databases; inspect and clear cookies; and inspect Resources.
*Make your XML code easy to read and understand with our free online XML Prettify tool. Format your code for better readability and save time! *
The security panel in Chrome developer tools displays connection security information for all network requests. This panel is used to determine if the data collected through network requests are secure or not. The website or network request will display a green lock icon if it is secure.
This panel can be used to view SSL certificates and encryption types of each network request and overall website. To open the security panel, we can click on the Security tab in the Chrome DevTools.
As shown in the image above, the security panel provides information about
Certificate verification, indicating whether the website has proven its identity with a TLS certificate.
TLS connection, indicating whether the website uses a modern and secure protocol.
Subresource security indicates whether the website loads insecure HTTP subresources (mixed content).
Google Lighthouse is an open-source, free tool that can help developers and testers analyze and improve the website’s performance, speed, and overall experience by generating a Lighthouse report.
The lighthouse panel in Chrome developer tools is equipped with Google Lighthouse, which can audit the website without any extra plugins or widgets. To audit a website on Chrome DevTool follow the steps below:
Navigate to the Lighthouse tab on Chrome developer tools.
Click on the “Generate Report” button in the image below.
It allows us to assess a website’s SEO, performance, accessibility, best practices in code, and progressive web app. It is also highly configurable, making it flexible and useful for all types of sites, from the simple to the highly complex. This flexibility includes several categories to run audits on both mobile and desktop devices.
Auditing the website uses a 1 to 100 scoring system based on tests run against a simulated 4G connection of the selected data. A generated report for the LambdaTest home page is shown below.
*Use our free online Random Number Generator tool to create unique non-repeating random numbers. Input your lower and upper range and get numbers with a click. *
Chrome developer tools can be used in various scenarios to help us develop better websites. Here are a few common use cases of Chrome developer tools:
**Front-end developers and testers most commonly use Chrome developer tools to check the responsiveness of websites. It allows managing viewport appearance using both free scaling and preselected sizes. This feature is available in the elements panel.
**Style into the website
**If we are trying to improve the design of an existing web page, we can navigate to one already existing and inspect it with Chrome developer tools. So if layout, sizing, colors, or design is an issue, we can modify the CSS and check if our copy still looks good in the environment it will be displayed. Finally, we can make the same change in our actual code base by copy-pasting.
**Identify issues in the website
**Catch non-working plugins
**Almost every website relies on a third-party plugin and widgets. Whether for analytics tools, form or popup tools, or chat add-ons, it’s crucial to keep track of whether they are working properly. Chrome DevTools can greatly help us in testing the performance of these tools.
Although the Chrome developer tools running on our physical devices can greatly help us analyze and improve the website performance in various aspects, we must ensure that our website performs the same in all different browser versions, platforms, and devices. To achieve this, we may run real time testing on cloud based testing tools.
Cloud-based automation tools are handy because they can test our app in almost all popular browsers and platforms, ensuring better quality assurance for the web app. One such popular cloud based testing platform trusted by large enterprises as well as startups is LambdaTest.
*Stop using the same password for everything! Create strong and unique passwords that are difficult to guess with our Random Password Generator. Try it now! *
To launch developer tools on LambdaTest, we can follow the steps below:
Before proceeding we must create a LambdaTest account by registering for free and then navigate to the dashboard.
Navigate to the real time testing dashboard by clicking the Real Time button from the left navigation menu.
- Select the test configuration as per your choice. You can select from 8 different browsers on desktop and phone devices & their hundreds of versions to perform a real time test session. You may also select from multiple operating systems and screen resolutions for evaluating the website when rendered across various devices of different screen sizes.
- After selecting browser configuration, enter a URL and hit the Start button to start testing.
*Generate custom QR codes for your business or personal needs with our fast and easy-to-use QR code generator online tool in seconds. Try it now! *
5. For desktop devices: Once the desired virtual machine is launched and operable, Right-click anywhere on the loaded webpage and click on the Inspect option.
6. For mobile devices: If your selected configuration of VM is a mobile device and once it is launched and operable, you can notice controller buttons on the left side of the screen. Click the icon button with the tools icon to open developer tools.
LambdaTest brings a brand new Chrome extension called LT Debug to make the life of testers and developers easy and fuss-free while debugging. This free developer tool is simple to use with over nine amazing features used by web developers and testers during debugging on a day-by-day basis.
Even though there are various debugging tools in the market, we believe we are one among them! Here are some top reasons to trust our LT Debug Chrome extension:
It’s free to use forever.
All you need to do is fill out a simple form and start your debugging.
It provides access to 100+ extensions, to make the life of developers and testers easier.
*Need a barcode for your products? Create high-quality custom barcodes using our online barcode generator. Try our barcode generator tool and get one in seconds! *
Here is our simple step-by-step guide on the installation process of LT debug:
Step 1: Go to the official LT Debug Chrome Extension page.
Step 2: Press the Add to Chrome button. You will be redirected to the Chrome web store.
*Need a list of names for your project or looking a way to find cool and funky names? Use our Random Name Generator tool to generate unique and creative names instantly. *
Step 3: Now press the Add to Chrome button on the top right. A pop-up will appear asking if you want to add “LT Debug” to the browser. Tap on Add extension.
Step 4: All done! Now, you can select the feature you want to use and start debugging.
*Tired of manually splitting long text strings? Try out our free online String Split by Delimiter tool to quickly split text strings into separate chunks using any delimiter of your choice. *
So there you have it! This article provides a basic overview of how Chrome developer tools can be used to test and debug your web apps and how you can use developer tools to test your web apps with cloud based testing tools. We also discussed some common use cases where Chrome developer tools can greatly help the developers.