{"id":137529,"date":"2025-09-30T11:39:58","date_gmt":"2025-09-30T08:39:58","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=137529"},"modified":"2025-09-30T11:40:01","modified_gmt":"2025-09-30T08:40:01","slug":"how-to-capture-json-responses-in-selenium-using-browsermob-proxy","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html","title":{"rendered":"How to Capture JSON Responses in Selenium Using BrowserMob Proxy"},"content":{"rendered":"<p>Selenium WebDriver is a framework for browser automation, but it was not originally designed to handle API responses. In real-world testing scenarios, web applications frequently fetch data using asynchronous calls that return JSON payloads. To validate such responses, we can extend <a href=\"https:\/\/www.javacodegeeks.com\/getting-started-with-selenium-2-0-cheatsheet.html\" target=\"_blank\" rel=\"noreferrer noopener\">Selenium<\/a> by pairing it with <a href=\"https:\/\/github.com\/lightbody\/browsermob-proxy\" target=\"_blank\" rel=\"noreferrer noopener\">BrowserMob Proxy<\/a>, a tool that intercepts network traffic and makes responses available for inspection. In this article, we demonstrate how to capture and parse JSON responses in Selenium with a practical example.<\/p>\n<h2 class=\"wp-block-heading\">1. What is BrowserMob Proxy<\/h2>\n<p>BrowserMob Proxy is a free and open-source tool that helps developers monitor and manipulate network traffic in web applications. Acting as an HTTP proxy server, it provides several key capabilities.<\/p>\n<p>It supports <strong>traffic manipulation<\/strong>, allowing developers to modify HTTP requests and responses, whitelist or blacklist resources, simulate network conditions such as latency and bandwidth, and even rewrite headers or content. It can also <strong>capture performance data<\/strong>, exporting detailed information in the standard HAR (HTTP Archive) format, which records web page loading performance.<\/p>\n<p>When integrated with automation frameworks like <strong>Selenium WebDriver<\/strong>, BrowserMob Proxy becomes especially valuable, enabling the capture of client-side performance metrics during automated testing and offering insights into application performance bottlenecks. Finally, it can be used either as a <strong>standalone proxy server<\/strong> or embedded directly into Java-based programs and unit tests, making it highly flexible for different use cases.<\/p>\n<h2 class=\"wp-block-heading\">2. What is HAR (HTTP Archive)?<\/h2>\n<p>A HAR file is a JSON-based log of all network traffic generated by the browser. It includes:<\/p>\n<ul class=\"wp-block-list\">\n<li>Request URLs and methods.<\/li>\n<li>Response status codes and headers.<\/li>\n<li>Full request and response payloads.<\/li>\n<\/ul>\n<p>By enabling HAR capture in BrowserMob Proxy, we can extract the raw JSON responses that the application fetches in the background.<\/p>\n<h2 class=\"wp-block-heading\">3. Getting Started: Prerequisites<\/h2>\n<p>Selenium WebDriver controls browsers, but it does not directly expose APIs for capturing network traffic. That\u2019s where BrowserMob Proxy comes in. It acts as a middleman between Selenium and the website, recording all network traffic in the form of an <strong>HTTP Archive (HAR)<\/strong> file. From there, we can extract JSON data.<\/p>\n<p>To follow along, you should have:<\/p>\n<ul class=\"wp-block-list\">\n<li>Basic knowledge of Java and Maven<\/li>\n<li>Java 11+ installed<\/li>\n<li>Chrome browser installed<\/li>\n<li>ChromeDriver (managed automatically with WebDriverManager in this article)<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\">3.1 Project Setup<\/h3>\n<p>We\u2019ll use Maven to manage dependencies for Selenium, BrowserMob Proxy, and Jackson. Maven makes it easy to configure and build the project.<\/p>\n<pre class=\"brush:xml\">\n        &lt;dependency&gt;\n            &lt;groupId&gt;org.seleniumhq.selenium&lt;\/groupId&gt;\n            &lt;artifactId&gt;selenium-java&lt;\/artifactId&gt;\n            &lt;version&gt;4.35.0&lt;\/version&gt;\n        &lt;\/dependency&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;io.github.bonigarcia&lt;\/groupId&gt;\n            &lt;artifactId&gt;webdrivermanager&lt;\/artifactId&gt;\n            &lt;version&gt;6.3.2&lt;\/version&gt;\n        &lt;\/dependency&gt; \n        &lt;dependency&gt;\n            &lt;groupId&gt;net.lightbody.bmp&lt;\/groupId&gt;\n            &lt;artifactId&gt;browsermob-core&lt;\/artifactId&gt;\n            &lt;version&gt;2.1.5&lt;\/version&gt;\n        &lt;\/dependency&gt; \n<\/pre>\n<p>This configuration includes Selenium WebDriver for automation, BrowserMob Proxy for intercepting network traffic and WebDriverManager for managing browser drivers automatically.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h2 class=\"wp-block-heading\">4. Building a Sample HTML Page<\/h2>\n<p>Here\u2019s a minimal HTML page that fetches a JSON response from the <a href=\"https:\/\/jsonplaceholder.typicode.com\" target=\"_blank\" rel=\"noreferrer noopener\">JSONPlaceholder API<\/a> when the page loads. We will save this file in the <code>src\/main\/resources<\/code> folder.<\/p>\n<pre class=\"brush:html\">\n&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;title&gt;Selenium JSON Capture Test&lt;\/title&gt;\n    &lt;style&gt;\n        body {\n            font-family: Arial, sans-serif;\n            margin: 20px;\n        }\n        pre {\n            background-color: #f4f4f4;\n            border: 1px solid #ddd;\n            padding: 10px;\n            border-radius: 6px;\n            white-space: pre-wrap;\n            word-wrap: break-word;\n            max-width: 600px;\n        }\n    &lt;\/style&gt;\n    &lt;script&gt;\n        async function fetchData() {\n            try {\n                const response = await fetch(\"https:\/\/jsonplaceholder.typicode.com\/posts\/3\");\n                const data = await response.json();\n                console.log(\"Fetched JSON:\", data);\n\n                \/\/ Display JSON in the &lt;pre&gt; tag\n                document.getElementById(\"json-output\").textContent = JSON.stringify(data, null, 2);\n            } catch (error) {\n                console.error(\"Error fetching JSON:\", error);\n                document.getElementById(\"json-output\").textContent = \"Failed to fetch JSON.\";\n            }\n        }\n        window.onload = fetchData;\n    &lt;\/script&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;h1&gt;Selenium JSON Capture Example&lt;\/h1&gt;\n    &lt;p&gt;The JSON response from &lt;code&gt;jsonplaceholder.typicode.com&lt;\/code&gt; will appear below:&lt;\/p&gt;\n    &lt;pre id=\"json-output\"&gt;Loading...&lt;\/pre&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/pre>\n<p>This HTML page makes a JSON API call when the page loads. By opening this page in Selenium with BrowserMob Proxy enabled, we can capture and parse the JSON response. You can serve the HTML page locally using any lightweight server. For example:<\/p>\n<p><strong>Python<\/strong><\/p>\n<pre class=\"brush:bash\">\npython3 -m http.server 8000\n<\/pre>\n<p><strong>Node.js (http-server)<\/strong><\/p>\n<pre class=\"brush:bash\">\nnpx http-server -p 8000\n<\/pre>\n<h2 class=\"wp-block-heading\">5. Java Code to Capture JSON Responses<\/h2>\n<p>The following Java program demonstrates how to capture JSON responses with BrowserMob Proxy HAR.<\/p>\n<pre class=\"brush:java\">\npublic class SeleniumJsonResponse {\n\n    public static void main(String[] args) throws Exception {\n        \/\/ Start BrowserMob Proxy\n        BrowserMobProxy proxy = new BrowserMobProxyServer();\n        proxy.start(0);\n\n        \/\/ Get Selenium Proxy\n        Proxy seleniumProxy = ClientUtil.createSeleniumProxy(proxy);\n\n        \/\/ Enable request\/response content capture\n        proxy.enableHarCaptureTypes(CaptureType.REQUEST_CONTENT, CaptureType.RESPONSE_CONTENT);\n\n        DesiredCapabilities cap = new DesiredCapabilities();\n        cap.setCapability(CapabilityType.PROXY, seleniumProxy);\n\n        \/\/ Configure ChromeDriver with proxy\n        ChromeOptions options = new ChromeOptions();\n        options.addArguments(\"--disable-web-security\");\n        options.addArguments(\"--allow-insecure-localhost\");\n        options.addArguments(\"--ignore-urlfetcher-cert-requests\");\n        options.setProxy(seleniumProxy);\n        cap.setCapability(ChromeOptions.CAPABILITY, options);\n\n        WebDriver driver = new ChromeDriver(options);\n\n        try {\n            \/\/ Enable HAR capture\n            proxy.newHar(\"demo\");\n\n            \/\/ Navigate to test page\n            driver.get(\"http:\/\/localhost:8000\/index.html\");\n\n            \/\/ Wait a bit for network activity\n            Thread.sleep(3000);\n\n            Har har = proxy.getHar();\n            File harFile = new File(\"json.har\");\n            har.writeTo(harFile);\n            \n        } finally {\n            driver.quit();\n            proxy.stop();\n        }\n\n    }\n}\n<\/pre>\n<p>When you run this file, it starts a BrowserMob Proxy server and configures ChromeDriver to route all browser traffic through the proxy. Once the proxy is running, it begins recording a HAR (HTTP Archive) of network activity. The browser then opens the local test page (<code>index.html<\/code>), which makes a JSON API request. <\/p>\n<p>During this time, BrowserMob Proxy captures both the request and response payloads. After waiting a few seconds for the network call to complete, the HAR data is retrieved and written into a file named <code>json.har<\/code>. Finally, the browser and proxy are shut down. The result is a complete HAR file on disk.<\/p>\n<p><strong>Capturing HAR Files with Chrome Developer Tools<\/strong><\/p>\n<p>To get started, open your application in Google Chrome and press <strong>F12<\/strong> (or <strong>Cmd + Option + I<\/strong> on macOS) to launch Developer Tools. Next, navigate to the <strong>Network<\/strong> tab and check the <strong>Preserve log<\/strong> option. This step is important because it ensures that the log is not cleared whenever the page reloads or navigates. After enabling this option, you should reload the page and visit the test page so that the network requests you want to capture are recorded.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/har.png\"><img decoding=\"async\" width=\"1024\" height=\"704\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/har-1024x704.png\" alt=\"Screenshot showing how to as HAR\" class=\"wp-image-137831\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/har-1024x704.png 1024w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/har-300x206.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/har-768x528.png 768w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/har-220x150.png 220w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/har.png 1061w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n<p>Once network activity is being recorded, we can also export the traffic as a HAR file by simply clicking on the download arrow button in the Network tab. This saves the HAR log to a <code>.har<\/code> file, preserving the complete request and response bodies. We can later share this file or analyze it in detail using <a href=\"http:\/\/www.softwareishard.com\/har\/viewer\/\" target=\"_blank\" rel=\"noreferrer noopener\">HAR viewer<\/a>.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/harviewer.png\"><img decoding=\"async\" width=\"1024\" height=\"704\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/harviewer-1024x704.png\" alt=\"\" class=\"wp-image-137833\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/harviewer-1024x704.png 1024w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/harviewer-300x206.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/harviewer-768x528.png 768w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/harviewer-220x150.png 220w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/harviewer.png 1061w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\">6. Conclusion<\/h2>\n<p>In this article, we examined how to capture JSON responses in Selenium with the help of BrowserMob Proxy. We started by introducing BrowserMob Proxy, highlighting its key features, and explaining the importance of HAR files for recording web performance data. From there, we demonstrated how to capture network traffic using HAR files. Finally, we explored how Chrome Developer Tools can be leveraged to manually record and export HAR files for further analysis.<\/p>\n<h2 class=\"wp-block-heading\">7. Download the Source Code<\/h2>\n<p>This article discussed the use of Selenium to capture and process JSON response data.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2025\/09\/selenium-json-response.zip\"><strong>selenium json response<\/strong><\/a>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Selenium WebDriver is a framework for browser automation, but it was not originally designed to handle API responses. In real-world testing scenarios, web applications frequently fetch data using asynchronous calls that return JSON payloads. To validate such responses, we can extend Selenium by pairing it with BrowserMob Proxy, a tool that intercepts network traffic and &hellip;<\/p>\n","protected":false},"author":128888,"featured_media":93767,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[4586,4588,4587,4589,287,4590],"class_list":["post-137529","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-browsermob-proxy","tag-chrome-developer-tools","tag-har-file","tag-json-response","tag-selenium","tag-selenium-webdriver"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Capture JSON Responses in Selenium Using BrowserMob Proxy - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Discover how to capture JSON response in Selenium using BrowserMob Proxy, with practical guidance for setup and validation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Capture JSON Responses in Selenium Using BrowserMob Proxy - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Discover how to capture JSON response in Selenium using BrowserMob Proxy, with practical guidance for setup and validation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/web.facebook.com\/omos.aziegbe\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-30T08:39:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-30T08:40:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/selenium-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Omozegie Aziegbe\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/OAziegbe\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Omozegie Aziegbe\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html\"},\"author\":{\"name\":\"Omozegie Aziegbe\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/7d3eac6e45542536e961129ae0fb453e\"},\"headline\":\"How to Capture JSON Responses in Selenium Using BrowserMob Proxy\",\"datePublished\":\"2025-09-30T08:39:58+00:00\",\"dateModified\":\"2025-09-30T08:40:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html\"},\"wordCount\":863,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/selenium-logo.jpg\",\"keywords\":[\"BrowserMob Proxy\",\"Chrome Developer Tools\",\"HAR File\",\"JSON Response\",\"Selenium\",\"Selenium WebDriver\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html\",\"name\":\"How to Capture JSON Responses in Selenium Using BrowserMob Proxy - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/selenium-logo.jpg\",\"datePublished\":\"2025-09-30T08:39:58+00:00\",\"dateModified\":\"2025-09-30T08:40:01+00:00\",\"description\":\"Discover how to capture JSON response in Selenium using BrowserMob Proxy, with practical guidance for setup and validation.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/selenium-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/selenium-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"How to Capture JSON Responses in Selenium Using BrowserMob Proxy\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/7d3eac6e45542536e961129ae0fb453e\",\"name\":\"Omozegie Aziegbe\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/cropped-jcg_profile_pic-96x96.jpg\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/cropped-jcg_profile_pic-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/cropped-jcg_profile_pic-96x96.jpg\",\"caption\":\"Omozegie Aziegbe\"},\"description\":\"Omos Aziegbe is a technical writer and web\\\/application developer with a BSc in Computer Science and Software Engineering from the University of Bedfordshire. Specializing in Java enterprise applications with the Jakarta EE framework, Omos also works with HTML5, CSS, and JavaScript for web development. As a freelance web developer, Omos combines technical expertise with research and writing on topics such as software engineering, programming, web application development, computer science, and technology.\",\"sameAs\":[\"https:\\\/\\\/web.facebook.com\\\/omos.aziegbe\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/omosaziegbe\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/OAziegbe\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/omozegie-aziegbe\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Capture JSON Responses in Selenium Using BrowserMob Proxy - Java Code Geeks","description":"Discover how to capture JSON response in Selenium using BrowserMob Proxy, with practical guidance for setup and validation.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html","og_locale":"en_US","og_type":"article","og_title":"How to Capture JSON Responses in Selenium Using BrowserMob Proxy - Java Code Geeks","og_description":"Discover how to capture JSON response in Selenium using BrowserMob Proxy, with practical guidance for setup and validation.","og_url":"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_author":"https:\/\/web.facebook.com\/omos.aziegbe","article_published_time":"2025-09-30T08:39:58+00:00","article_modified_time":"2025-09-30T08:40:01+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/selenium-logo.jpg","type":"image\/jpeg"}],"author":"Omozegie Aziegbe","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/OAziegbe","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Omozegie Aziegbe","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html"},"author":{"name":"Omozegie Aziegbe","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/7d3eac6e45542536e961129ae0fb453e"},"headline":"How to Capture JSON Responses in Selenium Using BrowserMob Proxy","datePublished":"2025-09-30T08:39:58+00:00","dateModified":"2025-09-30T08:40:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html"},"wordCount":863,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/selenium-logo.jpg","keywords":["BrowserMob Proxy","Chrome Developer Tools","HAR File","JSON Response","Selenium","Selenium WebDriver"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html","url":"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html","name":"How to Capture JSON Responses in Selenium Using BrowserMob Proxy - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/selenium-logo.jpg","datePublished":"2025-09-30T08:39:58+00:00","dateModified":"2025-09-30T08:40:01+00:00","description":"Discover how to capture JSON response in Selenium using BrowserMob Proxy, with practical guidance for setup and validation.","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/selenium-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/selenium-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/how-to-capture-json-responses-in-selenium-using-browsermob-proxy.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"How to Capture JSON Responses in Selenium Using BrowserMob Proxy"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/7d3eac6e45542536e961129ae0fb453e","name":"Omozegie Aziegbe","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2023\/12\/cropped-jcg_profile_pic-96x96.jpg","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2023\/12\/cropped-jcg_profile_pic-96x96.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2023\/12\/cropped-jcg_profile_pic-96x96.jpg","caption":"Omozegie Aziegbe"},"description":"Omos Aziegbe is a technical writer and web\/application developer with a BSc in Computer Science and Software Engineering from the University of Bedfordshire. Specializing in Java enterprise applications with the Jakarta EE framework, Omos also works with HTML5, CSS, and JavaScript for web development. As a freelance web developer, Omos combines technical expertise with research and writing on topics such as software engineering, programming, web application development, computer science, and technology.","sameAs":["https:\/\/web.facebook.com\/omos.aziegbe","https:\/\/www.linkedin.com\/in\/omosaziegbe\/","https:\/\/x.com\/https:\/\/twitter.com\/OAziegbe"],"url":"https:\/\/www.javacodegeeks.com\/author\/omozegie-aziegbe"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/137529","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/128888"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=137529"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/137529\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/93767"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=137529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=137529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=137529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}