How to use the appium-remote-debugger.RemoteDebugger.EVENT_FRAMES_DETACHED function in appium-remote-debugger

To help you get started, we’ve selected a few appium-remote-debugger examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appium / appium-ios-driver / lib / commands / context.js View on Github external
'that the proxy is running and accessible');
      this.remote = null;
      pageArray = [];
    }
  } else {
    // simulator, and not connected
    this.remote = await this.getNewRemoteDebugger();

    let appInfo = await this.remote.connect();
    if (!appInfo) {
      logger.debug('Unable to connect to the remote debugger.');
      return [];
    }
    pageArray = await this.remote.selectApp(currentUrl, this.opts.webviewConnectRetries, this.opts.ignoreAboutBlankUrl);
    this.remote.on(RemoteDebugger.EVENT_PAGE_CHANGE, this.onPageChange.bind(this));
    this.remote.on(RemoteDebugger.EVENT_FRAMES_DETACHED, () => {
      if (!_.isEmpty(this.curWebFrames)) {
        logger.debug(`Clearing ${this.curWebFrames.length} frames: ${this.curWebFrames.join(', ')}`);
      }
      this.curWebFrames = [];
    });

    let tryClosingAlert = async () => {
      let didDismiss = await this.closeAlertBeforeTest();
      if (!didDismiss) {
        throw new Error('Close alert failed. Retry.');
      }
    };
    try {
      await retryInterval(3, 4000, tryClosingAlert);
    } catch (err) {
      // if the loop to close alerts failed to dismiss, ignore,
github appium / appium-xcuitest-driver / lib / commands / context.js View on Github external
extensions.connectToRemoteDebugger = async function connectToRemoteDebugger () {
  this.remote = await this.getNewRemoteDebugger();
  await this.remote.connect();

  this.remote.on(RemoteDebugger.EVENT_PAGE_CHANGE, this.onPageChange.bind(this));
  this.remote.on(RemoteDebugger.EVENT_FRAMES_DETACHED, () => {
    if (!_.isEmpty(this.curWebFrames)) {
      log.debug(`Clearing ${this.curWebFrames.length} frames: ${this.curWebFrames.join(', ')}`);
    }
    this.curWebFrames = [];
  });
};