Configuring proxy in Webdriver-IO standalone

Viewed 11

Background: Here is my situation, I have a website I access that requires me to go through a proxy. For day-to-day use, I installed the chrome extension Proxy switchyomega to switch between proxies based on a URL wildcard. For example, when I go to URL abc.xyz.com my company requires me to use a proxy at x.x.x.x:yyyy.

Issue I am trying to write an automation script using WebdriverIO (version 7.24.0) in standalone mode using chrome that will launch the website abc.xyz.com. The problem is when I run the script it is not going through the proxy, so my access is blocked. I have tried to configure a proxy in the capabilities but that does not seem to work, and I'm wondering if I'm doing something wrong in my configuration, which is below

const { remote } = require("webdriverio");

const browser = await remote({
        capabilities: {
            browserName: "chrome",
            proxy: {
              proxyType: "manual",
              httpProxy: "x.x.x.x:yyyy"
            }
        },
    });

await browser.url("abc.xyz.com");

As mentioned in normal use when I access URL abc.xyz.com it routes through the x.x.x.x:yyyy proxy and that is what I need to happen when running my script but the above configuration does not seem to do anything.

Any help would be appreciated.

0 Answers
Related