Using network throttling for chrome plating

I saw that chromedriver released an update that activated the network throttling feature in the desired capabilities. I tried, but it still uses the same speed with any configuration. See code below:

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities


def test_youtube():
    d = DesiredCapabilities.CHROME
    d['networkConnectionEnabled'] = {'type': 'Wifi'}
    driver = webdriver.Chrome(executable_path='path',desired_capabilities=d)
    driver.get('http://www.youtube.com')
    print driver.title
    driver.save_screenshot('test.png')
    driver.quit()
+4
source share

Source: https://habr.com/ru/post/1658966/


All Articles