gemini icon indicating copy to clipboard operation
gemini copied to clipboard

Cannot launch browser chrome: Could not calibrate. (MacOs)

Open bjornicus opened this issue 8 years ago â€Ē 21 comments
trafficstars

Following the basic example in the readme does not work for me because of chrom calibration failing. If I disable calibration it seems to work as expected.

Output of gemini --version: 4.18.1

Contents of .gemini.js file:

module.exports = {
    rootUrl: 'http://yandex.ru',
    gridUrl: 'http://127.0.0.1:4444/wd/hub',

    browsers: {
        chrome: {
            desiredCapabilities: {
                browserName: 'chrome'
            }
        }
    }
};

Test source code:

gemini.suite('yandex-search', (suite) => {
    suite.setUrl('/')
        .setCaptureElements('.home-logo')
        .capture('plain');
});

Command used to run the test:

gemini test --reporter flat --reporter html

Expected behaviour: A chrome window should open, load the yandex.ru page, and generate a test report

Actual behavior: A chrome window opens with a solid green background, waits for some time, and then closes. The command line shows the message:

annot launch browser chrome:
Could not calibrate. This could be due to calibration page has failed to open properly.
Total: 1 Passed: 0 Failed: 1 Skipped: 0 Retries: 0
Your HTML report is here: file:///Users/bjorn/test/gemini-report/index.html

simply adding calibrate: false, to the gemini.js file makes it work. Here is the updated contents:

module.exports = {
    rootUrl: 'http://yandex.ru',
    gridUrl: 'http://127.0.0.1:4444/wd/hub',
    calibrate: false,

    browsers: {
        chrome: {
            desiredCapabilities: {
                browserName: 'chrome'
            }
        }
    }
};

bjornicus avatar Mar 22 '17 23:03 bjornicus

Hello! In my case everything works fine without calibrate: false. Which version of chrome and selenium-standalone do you use?

rostik404 avatar Mar 24 '17 15:03 rostik404

chrome is Version 56.0.2924.87 (64-bit) selenium is from https://www.npmjs.com/package/selenium-standalone, which looks to have installed Selenium build info: version: '3.0.1', revision: '1969d75'

On Fri, Mar 24, 2017 at 8:38 AM, Rostislav Shtanko <[email protected]

wrote:

Hello! In my case everything works fine without calibrate: false. Which version of chrome and selenium-standalone do you use?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gemini-testing/gemini/issues/753#issuecomment-289058295, or mute the thread https://github.com/notifications/unsubscribe-auth/ABpiGAtCY_wxjqsq2T99ZMJ2dDbLcOJLks5ro-OEgaJpZM4Ml8n5 .

bjornicus avatar Mar 24 '17 17:03 bjornicus

I tried to reproduce it on latest gemini and selenium-standalone versions (macOS) - all works fine for me

sipayRT avatar Mar 31 '17 14:03 sipayRT

I have the same issue. Can it be OS thing? I switched to Sierra and it's not working. Last time I've been on my old Mac, it used to launch normally.

varya avatar Apr 04 '17 11:04 varya

Ah, my issue it a little bit different, but I suppose related

✘ 2.1 plain [chrome-latest]
Cannot launch browser chrome-latest:
undefined while parsing file: /Users/varya/WebDev/SC5/sc5-styleguide-visualtest/node_modules/gemini/lib/browser/client-scripts/gemini.js.

varya avatar Apr 04 '17 11:04 varya

I have the same issue. Can it be OS thing?

I will try it on latest version. But it works on Sierra 10.12.3

Ah, my issue it a little bit different, but I suppose related

it can be because of switching node version. You can try to reinstall gemini

sipayRT avatar Apr 05 '17 09:04 sipayRT

I'm getting this error intermittently on build machines... @sipayRT any update? @varya @bjornicus any workaround you came up with?

bruk1977 avatar Jun 06 '17 19:06 bruk1977

Same issue here... I'm making it as written in https://github.com/gemini-testing/gemini, selenium-standalone: Selenium build info: version: '3.6.0', revision: '6fbf3ec767'.

Chrome launches but there is a green screen then it fails with: Cannot launch browser chrome: Could not calibrate. This could be due to calibration page has failed to open properly.

Chrome is latest for today: 62.0.3202.94, also tried with ChromeDriver 2.33.506106, gemini: 5.0.0-alpha.10, MacOs 10.12.6, node v6.10.2

with firefox I get: Cannot launch browser firefox: Not a PNG.

campside avatar Dec 06 '17 13:12 campside

@campside try to check your page on client errors - while calibration gemini should execute js-scripts on the page. So if there will be some client errors calibration will fail

sipayRT avatar Dec 08 '17 11:12 sipayRT

The same issue. Even adding calibrate: false to the config doesn't help:

  • with option chrome is open with solid green, closes after a few seconds and reports an error
  • w/o option – just reports an error

gemini: 5.0.0-alpha.10 Mac OS 10.12.6 node v9.2.0

lahmatiy avatar Dec 09 '17 23:12 lahmatiy

can you provide your error log without calibration? Also it will be helpful to get your page which you tried to open.

sipayRT avatar Dec 11 '17 11:12 sipayRT

👀

miripiruni avatar Dec 11 '17 14:12 miripiruni

Now I have the same issue as @lahmatiy. Green Chrome, adding calibrate: false does not work. What kind of logs you need to investigate this?

varya avatar Jan 22 '18 09:01 varya

What kind of logs you need to investigate this?

all logs from terminal, pls.

sipayRT avatar Jan 23 '18 17:01 sipayRT

In terminal, it is like that

  𝒟â„ī gulp test:visual
[13:23:44] Failed to load external module @babel/register
[13:23:44] Requiring external module babel-register
[13:23:49] Using gulpfile ~/WebDev/SC5/Elisa/pattern-library/gulpfile.babel.js
(node:43088) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[13:23:49] Starting 'dev:options'...
[13:23:49] Finished 'dev:options' after 245 Ξs
[13:23:49] Starting 'test:visual'...
Test server:  selenium
Test resolution:  1250x730
Test server: SELENIUM
Selenium started
✘ 1.1.1.1 plain [chrome-latest]
Cannot launch browser chrome-latest:
Could not calibrate. This could be due to calibration page has failed to open properly.

varya avatar Feb 06 '18 11:02 varya

can you share your test page? so I can check your problem locally

sipayRT avatar Feb 07 '18 07:02 sipayRT

I will try to develop the test page later today.

varya avatar Feb 07 '18 07:02 varya

I had the issue on example from the readme, nothing extra. Try to install gemini and its deps on a clean macOS and run a basic test from readme. I suppose the problem is about using https, but not sure. I switched off calibration and it doesn't help. Later I opened yandex.ru in Chrome (since this host is used in example test), and some time later I tried to run the test again and it worked as expected. However calibration still doesn't work. I suppose something additional should be done to make genimi works.

lahmatiy avatar Feb 07 '18 10:02 lahmatiy

I am facing this issue as well.

MacOS: 10.13.4

package.json

    "chromedriver": "^2.36.0",
    "gemini": "^5.6.2",
    "selenium-standalone": "^6.14.0"

.gemini.js

const puppeteer = require("puppeteer");

module.exports = {
  rootUrl: "http://localhost:9000",
  gridUrl: "http://127.0.0.1:5678/wd/hub",
  calibrate: true,
  windowSize: "1920x1080",
  screenshotsDir: "./tests/screenshots",
  browsers: {
    chrome: {
      desiredCapabilities: {
        browserName: "chrome",
        chromeOptions: {
          args: ["--no-sandbox", "--headless"],
          binary: puppeteer.executablePath()
        }
      }
    }
  },
  system: {
    debug: true,
    plugins: {
      "html-reporter/gemini": {
        enabled: true,
        path: "gemini-reports/",
        defaultView: "all"
      }
    }
  }
};

Error message:

message: Cannot launch browser chrome: Could not calibrate. This could be due to calibration page has failed to open properly. stack: GeminiError: Cannot launch browser chrome: Could not calibrate. This could be due to calibration page has failed to open properly. at initSession.then.then.then.then.then.catch (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/browser/new-browser.js:115:31) at runCallback (timers.js:794:20) at tryOnImmediate (timers.js:752:5) at processImmediate [as _immediateCallback] (timers.js:729:5) From previous event: at NewBrowser.launch (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/browser/new-browser.js:107:19) at Object.start (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/browser-pool.js:13:37) at BasicPool.getBrowser (/All-Data/SAC/orca-react-ui/node_modules/gemini-core/lib/browser-pool/basic-pool.js:26:33) at CachingPool.getBrowser (/All-Data/SAC/orca-react-ui/node_modules/gemini-core/lib/browser-pool/caching-pool.js:43:40) at LimitedPool._newBrowser (/All-Data/SAC/orca-react-ui/node_modules/gemini-core/lib/browser-pool/limited-pool.js:77:36) at LimitedPool._getBrowser (/All-Data/SAC/orca-react-ui/node_modules/gemini-core/lib/browser-pool/limited-pool.js:62:25) at LimitedPool.getBrowser (/All-Data/SAC/orca-react-ui/node_modules/gemini-core/lib/browser-pool/limited-pool.js:34:21) at PerBrowserLimitedPool.getBrowser (/All-Data/SAC/orca-react-ui/node_modules/gemini-core/lib/browser-pool/per-browser-limited-pool.js:26:39) at BrowserAgent.getBrowser (/All-Data/SAC/orca-react-ui/node_modules/gemini-core/lib/browser-agent/index.js:17:27) at RegularSuiteRunner._doRun (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/runner/suite-runner/regular-suite-runner.js:29:35) at RegularSuiteRunner.run (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/runner/suite-runner/suite-runner.js:18:21) at InsistentSuiteRunner._doRun (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/runner/suite-runner/insistent-suite-runner.js:27:34) at InsistentSuiteRunner.run (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/runner/suite-runner/suite-runner.js:18:21) at BrowserRunner._runSuite (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/runner/browser-runner/index.js:71:23) at _.filter.map (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/runner/browser-runner/index.js:37:29) at arrayMap (/All-Data/SAC/orca-react-ui/node_modules/lodash/lodash.js:631:23) at Function.map (/All-Data/SAC/orca-react-ui/node_modules/lodash/lodash.js:9546:14) at interceptor (/All-Data/SAC/orca-react-ui/node_modules/lodash/lodash.js:16983:35) From previous event: at TestsRunner.run (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/runner/index.js:42:14) at getTests.then (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/gemini.js:190:31) From previous event: at Gemini._run (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/gemini.js:179:14) at _exec (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/gemini.js:89:38) at _init.then (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/gemini.js:97:40) From previous event: at Gemini._exec (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/gemini.js:97:29) at Gemini.test (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/gemini.js:89:21) at /All-Data/SAC/orca-react-ui/node_modules/gemini/lib/cli/index.js:106:30 at Command.program.command.allowUnknownOption.option.description.on.action (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/cli/index.js:47:69) at Command.listener (/All-Data/SAC/orca-react-ui/node_modules/commander/index.js:315:8) at emitTwo (events.js:126:13) at Command.emit (events.js:214:7) at Command.parseArgs (/All-Data/SAC/orca-react-ui/node_modules/commander/index.js:651:12) at Command.parse (/All-Data/SAC/orca-react-ui/node_modules/commander/index.js:474:21) at Object.exports.run (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/cli/index.js:80:13) at Object.<anonymous> (/All-Data/SAC/orca-react-ui/node_modules/gemini/bin/gemini:33:25) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:188:16) at bootstrap_node.js:609:3

hisivasankar avatar May 04 '18 14:05 hisivasankar

I found more info that might help.

Gemini is not working fine in following cases:

  • Calibration fails when using chrome on --headless mode.
  • In mac. I guess this is due to the high-resolution display. I just connected an external monitor(Full HD) to my mac and tested. All working fine.

Investigation details: I compared the resolution of the image taken in my mac(without calibration and calibration doesn't work in mac display in my case).

  • Mac Screenshot without calibration: 3808 × 96
  • Screenshot using external monitor: 1904 × 48

Right now solved my issue by just using an external monitor and enabling calibrate: true so that everything works fine in travis

hisivasankar avatar May 04 '18 14:05 hisivasankar

I'm seeing this happen in Windows 10 Pro x64 as well, using today's gemini, and selenium-standalone 6.15.4 with the example files as indicated over on https://github.com/gemini-testing/gemini

Chrome gets launched in "used for testing" mode, but it ends up showing a green screen, with the URL bar showing that it's trying to load data:, followed by about:blank, instead of loading the url indicated in the .gemini.js configuration.

Pomax avatar Dec 05 '18 17:12 Pomax