Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      June 4, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 4, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 4, 2025

      Smashing Animations Part 4: Optimising SVGs

      June 4, 2025

      I test AI tools for a living. Here are 3 image generators I actually use and how

      June 4, 2025

      The world’s smallest 65W USB-C charger is my latest travel essential

      June 4, 2025

      This Spotlight alternative for Mac is my secret weapon for AI-powered search

      June 4, 2025

      Tech prophet Mary Meeker just dropped a massive report on AI trends – here’s your TL;DR

      June 4, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Beyond AEM: How Adobe Sensei Powers the Full Enterprise Experience

      June 4, 2025
      Recent

      Beyond AEM: How Adobe Sensei Powers the Full Enterprise Experience

      June 4, 2025

      Simplify Negative Relation Queries with Laravel’s whereDoesntHaveRelation Methods

      June 4, 2025

      Cast Model Properties to a Uri Instance in 12.17

      June 4, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      My Favorite Obsidian Plugins and Their Hidden Settings

      June 4, 2025
      Recent

      My Favorite Obsidian Plugins and Their Hidden Settings

      June 4, 2025

      Rilasciata /e/OS 3.0: Nuova Vita per Android Senza Google, Più Privacy e Controllo per l’Utente

      June 4, 2025

      Rilasciata Oracle Linux 9.6: Scopri le Novità e i Miglioramenti nella Sicurezza e nelle Prestazioni

      June 4, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Unable to set proxy with BrowserMobProxy while modifying http header request in Selenium with Java

    Unable to set proxy with BrowserMobProxy while modifying http header request in Selenium with Java

    June 27, 2024

    I am able to modify http request header using BrowserMobProxy, the same way explained

    https://sqa.stackexchange.com/a/37318/9043

    But, the problem I am having at the moment is, that I am executing my scenarios on dev/local/playpen environment (environment before System integration testing). And to open the website on this environment needs proxy to set.

    When I set my proxy then it fails to modify header and apply the proxy. When I comment the proxy part then it easily modifies the header.

    BrowserMobProxy proxy = new BrowserMobProxyServer();
    proxy.start(0);
    Proxy seleniumProxy = ClientUtil.createSeleniumProxy(proxy);

    proxy.addRequestFilter((request, contents, messageInfo)->{
    request.headers().add(“some-header-attribute”, “RandomeValue”);
    System.out.println(request.headers().entries().toString());
    return null;
    });

    String _host = Utils.getConfigValue(“proxy.host”);
    String _port = Utils.getConfigValue(“proxy.port”);

    seleniumProxy.setProxyType(Proxy.ProxyType.MANUAL);
    seleniumProxy.setHttpProxy(_host + “:” + _port);
    seleniumProxy.setSslProxy(_host + “:” + _port);
    seleniumProxy.setFtpProxy(_host + “:” + _port);
    capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);

    String proxyOption = “–proxy-server=” + seleniumProxy.getHttpProxy();
    options.addArguments(proxyOption);

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleIs there a way to put an entire part of a request in a SoapUI variable?
    Next Article Solving the ‘Lost-in-the-Middle’ Problem in Large Language Models: A Breakthrough in Attention Calibration

    Related Posts

    Security

    HPE StoreOnce Faces Critical CVE-2025-37093 Vulnerability — Urges Immediate Patch Upgrade

    June 4, 2025
    Security

    Google fixes Chrome zero-day with in-the-wild exploit (CVE-2025-5419)

    June 4, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    CVE-2025-5501 – Open5GS NGAP PathSwitchRequest Message Handler Remote Assertion Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Market research platform Experial secures €2M Pre-Seed funding

    News & Updates

    Getting Started with 2D Physics in Godot [FREE]

    Development

    ELT IS DEAD. LONG LIVE ZERO COPY.

    Development

    Highlights

    Tech & Work

    Adaptive Video Streaming With Dash.js In React

    March 27, 2025

    I was recently tasked with creating video reels that needed to be played smoothly under…

    Why MongoDB is the Perfect Fit for a Unified Namespace

    April 3, 2025

    Best Free and Open Source Software: June 2024 Updates

    July 1, 2024

    CVE-2025-5033 – XiaoBingby TeaCMS Cross-Site Request Forgery Vulnerability

    May 21, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.