Is there a way to properly utilize the webdriverjs setNetworkConditions()
method as outlined in the official documentation?
This is what my code looks like:
const chromeCapabilities = webdriver.Capabilities.chrome()
const chromeOptions = {
'args': ['--headless', '--test-type', '--disable-extensions', '--disable-dev-shm-usage', '--no-sandbox', '--start-maximized', '--disable-infobars']
}
chromeCapabilities.set('chromeOptions', chromeOptions)
chromeCapabilities.set('browserName', config.browser)
chromeCapabilities.set('acceptInsecureCerts', true)
chromeCapabilities.set('networkConditions', {
offline: false,
latency: 50000
})
const driver = new webdriver.Builder().withCapabilities(chromeCapabilities).build()
driver.setNetworkConditions({
offline: false,
latency: 50000
})
However, when running the test, I encounter a
Property 'setNetworkConditions' does not exist on type 'ThenableWebDriver'.
error.
I came across another question addressing this issue on Stack Overflow, but unfortunately, it didn't provide a solution. I've been struggling with this problem for quite some time now and would appreciate any help or insights. Thank you!