I\'m using RobotFramework with Selenium library for writing automated test cases for various websites. I\'ve encountered an issue where due to slow loading from third-party URLs
For anyone who might need this, the solution is below:
Start Browser
[Documentation] Start browser
Set Selenium Implicit Wait 10
${BMPATH} Join Path ${EXECDIR} browsermob-proxy-2.1.4 bin browsermob-proxy.bat
Start Local Server ${BMPATH}
## Create dedicated proxy on BrowserMob Proxy
&{host} Create Dictionary port=7070
${BrowserMob_Proxy}= Create Proxy ${host}
Blacklist .*\/\/.*google.* 200
## Configure Webdriver to use BrowserMob Proxy
${options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${options} add_argument --start-maximized
Call Method ${options} add_argument --proxy-server\=localhost:7070
Create WebDriver Chrome chrome_options=${options}
This will start the chrome browser maximized and route traffic via BMP. The regex in the Blacklist line means it will block all URL containing 'google' and return status 200 (this can be changed at your will).