try {
    screenshot = await driver.takeScreenshot();
  } catch (e) {
    if (e.status === 6) {
      throw e;