Can the Browser Mob Proxy capture network traffic for applications that are running on localhost?

I'm currently working on creating a tool that automatically tracks client-side performance. I recently learned that browsermob proxy combined with selenium can be used to write tests for this purpose. However, I'm curious about the possibility of using BMP+Selenium to capture network traffic for applications running on localhost and generate HAR files.

Is it possible to use BMP+Selenium to capture network traffic for local applications and create HAR files?

While researching, I found out that tools like Firebug+NetExport and Chrome Dev Tools can also generate HAR files, but I am particularly interested in knowing if there are APIs available for these tasks, such as the Browser Navigation Timing API.

Answer №1

Utilizing ChromeDriver along with javascript enables the monitoring of performance metrics, as demonstrated in the following Java snippet:

ChromeDriver browser = startChromeDriver();
browser.get("http://example.com");
Object performanceData = browser.executeScript("return window.performance.getEntries();");

This script retrieves a JSON object filled with performance data that can be further analyzed.

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

The dropdown menu in Selenium is experiencing issues with option selection

I am currently working on scraping data from a specific website which can be found at the following link: My task involves navigating to the terminal code column and selecting 'General Cargo' Below is the HTML code snippet: <select name="te ...

Extracting Numbers from HTML using Selenium in Java

Is there a way to extract only the numbers (Code) from an html document? I currently have this String that retrieves the entire html: String value = driver.findElement(By.xpath("//*[@id=\"htmlSourceContent\"]")).getText(); My goal is to specifi ...

Pass various chosen checkboxes to Java by utilizing jQuery and Ajax technology

I am struggling with sending multiple selected checkboxes from HTML to Java using jQuery/Ajax. The issue is that when I check the result in Java, instead of getting the values I selected (e.g., National, State), I get "activityRangeCBs[]". Here is the HTM ...

What is the best approach to detect multiple .change() events on elements that are dynamically updated through AJAX interactions?

Here is my first question, and I will make sure to follow all the guidelines. In a PHP page, I have two select groups, with the second group initially disabled. The first select group is named "yearlist", while the second select group is named "makelist" ...

Jquery form calculation not matching up

I've been struggling to make this jQuery math function work with my form. The snippet works fine, but when I try to integrate it into the actual form, I can't seem to get it aligned properly to perform the required calculations. Any suggestions ...

Navigating Vue and Vuex: Managing interdependent computed values

My unique application is a simplified spreadsheet tool created using Vue and Vuex. It consists of three main components: TableCollection, Table, and Row. The TableCollection contains an array of multiple Table objects, each with its own array of multiple R ...

Tests using Cypress for end-to-end testing are failing to execute in continuous integration mode on gitlab.com

Challenges with Setting Up Cypress in Gitlab CI We have been facing difficulties setting up Cypress in the CI runners of gitlab.com using the default blueprint from vue-cli to scaffold the project. Despite trying various configurations in the gitlab.yml f ...

Fix a carousel layout problem

I've made changes to an HTML-PHP module to display portfolio images as a carousel, and I'm using the same module on this website too. However, I've encountered an issue with duplicate content and the previous-next navigation buttons. Can so ...

Utilizing Jquery for comparing and retrieving string arrays

Hey there! I'm currently working on a jQuery application and I'm facing an issue with comparing two arrays. Here is an example: FirstArray=["Mike","Jack"]; SecondArray=["Mike","Jack","Andy","Cruz"]; I want to find out which strings are common i ...

What is the best way to retrieve my chosen GridView rows and store them in a JavaScript variable?

Using ASP.NET C# MVC3 with razor templates, I have a question: In my DevExpress GridView, I can select rows. How can I pass the selected rows into a JavaScript variable? Also, if I select multiple rows simultaneously, is there a way to get them in an arra ...

What is the best way to create two fields side by side within a single row?

I'm struggling to merge the data array of two different identity types into one row as a field. Here's the code I've written: import React from 'react' import {Form,Field,ErrorMessage,Formik} from 'formik' import * as yup ...

Running tests in Selenium with Java using the @Factory annotation encountered an issue

Let me outline the structure of my class: package com.gex.base.helper; public class InitializeDriver extends BrowserFactory { HashMap<String, String> authenticationMap; @Factory(dataProvider="authentication", dataProviderClass=DataProvid ...

Exploring the process of iterating through JSON parameters on Android devices

Imagine having a JSON structure like the following: {"_id" :"4e3f2c6659f25a0f8400000b", "confirmation_code":"TWLNX8BT", "confirmed" :true, "created_at" :"2011-08-08T00:23:02+00:00", "email_address" :"dd5dc43ea6bf12ec604b0a ...

Python and Selenium scraping activity encountered captcha blocking on a website protected by DataDome security measures

I have been working on scraping car data from various websites using Selenium with Chrome browser. However, I've run into issues where some websites block Selenium with captcha validation after just 1 or 2 requests. One example of this is . I attempte ...

What is the best way to manage a multi-select dropdown with checkboxes in Selenium Webdriver?

Below is a snapshot of the drop-down I am working with. In order to handle multiple selections, I currently have code that clicks on the arrow in the drop-down and then selects the corresponding checkbox. However, I would like a more efficient solution fo ...

Transmitting messages to socket.io rooms using node.js

As I embark on building my first app in node.js - a chat application, I have encountered an issue with sending messages to the correct room. It seems that socket.room isn’t being stored, possibly due to my approach of refreshing the page for loading view ...

Proper Way to Initialize an Activity using a Custom View in a Java Class

I'm in the process of defining a custom Java class that extends a LinearLayout. This class needs to be able to initiate an activity when clicked. Below is a snippet of my code: public CustomClass(Context context, JSONObject jsonData) { su ...

Currently in the process of uploading a 30MB XML file for autocomplete

Currently, I am dealing with a large 30 MB XML file containing numerous words. I am considering two options for utilizing autocomplete effectively: loading the entire XML into an array or creating a cloud-based database and accessing the words through Res ...

Rearranging a JSON Object post editing

Currently, I am working on a project where I need to display and sort a list of items based on a JSON object. This includes sorting by both string values and integers within the object. So far, I have been successful in listing and sorting the items by st ...

Error Encountered in Next.js: PDFtron Webviewer - Troubleshooting

I'm currently working on a website that incorporates a dynamically imported PDF viewer within the page. When running the code locally, everything operates smoothly with no errors. However, when executing the "npm run build" command, I encounter the fo ...