'Import third party scraping framework

I'm having a hard time importing a scraping library SecretAgent into my Appium node app, I'm able to initialize Chrome via webdriverio but I want SecrentAgent to take over the chrome functionality or is this not possible? The SecretAgent is a node based library built with Chrome.

My code opens Chrome using webdriverio on the android device but opens Yahoo on my computer machine browser. I'm assuming it's the fact that the capabilities aren't being called with SecretAgent.

const wdio = require("webdriverio");
const assert = require("assert");
const secretagent = require("secretagent");

const opts = {
  path: '/wd/hub',
  port: 4723,
  capabilities: {
    platformName: "Android",
    udid: "XXXXXXXX",
    app: "/home/android/ApiDemos-debug.apk",
    appPackage: "io.appium.android.apis",
    appActivity: ".view.TextFields",
    automationName: "UiAutomator2",
    browserName: "Chrome"
  }
};

async function main () {
  //setup client
  const client = await wdio.remote(opts);

  //open chrome via webdriverio client
  client.url('https://google.com');

  //open chrome via SecrentAgent?
  agent.goto('https://yahoo.com');

  //end client
  await client.deleteSession();
}

// call function
main();


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source