angular / protractor

E2E test framework for Angular apps
http://www.protractortest.org
MIT License
8.75k stars 2.31k forks source link

Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. #5540

Closed marconemm closed 2 years ago

marconemm commented 2 years ago

Hi, comunity. I just tryed to start with protractor and already on my first test attempt I got this irresolvable error: : _Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUTINTERVAL.

I just tryed to reapeat the example like the Protractor GET STARTED documentation.

Following below is my troubleshoot log and webdriver-manager server log:

Troubleshoot log:

$-> protractor ./config/conf.js  --troubleshoot
[22:49:23] D/launcher - Running with --troubleshoot
[22:49:23] D/launcher - Protractor version: 7.0.0
[22:49:23] D/launcher - Your base url for tests is undefined
[22:49:23] I/launcher - Running 1 instances of WebDriver
[22:49:23] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[22:49:24] D/runner - WebDriver session successfully started with capabilities Capabilities {
  map_: Map(17) {
    'acceptInsecureCerts' => false,
    'browserName' => 'chrome',
    'browserVersion' => '96.0.4664.45',
    'chrome' => {
      chromedriverVersion: '96.0.4664.45 (76e4c1bb2ab4671b8beba3444e61c0f17584b2fc-refs/branch-heads/4664@{#947})',
      userDataDir: '/tmp/.com.google.Chrome.Aq3UZP'
    },
    'goog:chromeOptions' => { debuggerAddress: 'localhost:39139' },
    'networkConnectionEnabled' => false,
    'pageLoadStrategy' => 'normal',
    'platformName' => 'linux',
    'proxy' => {},
    'setWindowRect' => true,
    'strictFileInteractability' => false,
    'timeouts' => { implicit: 0, pageLoad: 300000, script: 30000 },
    'unhandledPromptBehavior' => 'dismiss and notify',
    'webauthn:extension:credBlob' => true,
    'webauthn:extension:largeBlob' => true,
    'webauthn:virtualAuthenticators' => true,
    'webdriver.remote.sessionid' => '1169620a0503e3bca82b215a0e73be70'
  }
}
[22:49:24] D/runner - Running with spec files /home/mmmendonca1/Documents/ProtractorProjects/automation_example/tests/todo-spec.js
Started
[22:50:14] E/protractor - Could not find Angular on page https://angularjs.org/ : retries looking for angular exceeded
FA Jasmine spec timed out. Resetting the WebDriver Control Flow.

Failures:
1) angularjs homepage todo list should add a todo
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at listOnTimeout (node:internal/timers:557:17)
        at processTimers (node:internal/timers:500:7)
  Message:
    Failed: Angular could not be found on the page https://angularjs.org/. If this is not an Angular application, you may need to turn off waiting for Angular.
                              Please see 
                              https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
  Stack:
    Error: Angular could not be found on the page https://angularjs.org/. If this is not an Angular application, you may need to turn off waiting for Angular.
                              Please see 
                              https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
        at /home/mmmendonca1/.nvm/versions/node/v16.13.0/lib/node_modules/protractor/built/browser.js:718:27
        at ManagedPromise.invokeCallback_ (/home/mmmendonca1/.nvm/versions/node/v16.13.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1376:14)
        at TaskQueue.execute_ (/home/mmmendonca1/.nvm/versions/node/v16.13.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:3084:14)
        at TaskQueue.executeNext_ (/home/mmmendonca1/.nvm/versions/node/v16.13.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:3067:27)
        at /home/mmmendonca1/.nvm/versions/node/v16.13.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2927:27
        at /home/mmmendonca1/.nvm/versions/node/v16.13.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:668:7
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
    From: Task: Run it("should add a todo") in control flow
        at UserContext.<anonymous> (/home/mmmendonca1/.nvm/versions/node/v16.13.0/lib/node_modules/protractor/node_modules/jasminewd2/index.js:94:19)
    From asynchronous test: 
    Error
        at Suite.<anonymous> (/home/mmmendonca1/Documents/ProtractorProjects/automation_example/tests/todo-spec.js:2:2)
        at Object.<anonymous> (/home/mmmendonca1/Documents/ProtractorProjects/automation_example/tests/todo-spec.js:1:1)
        at Module._compile (node:internal/modules/cjs/loader:1101:14)
        at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
        at Module.load (node:internal/modules/cjs/loader:981:32)
        at Function.Module._load (node:internal/modules/cjs/loader:822:12)

1 spec, 1 failure
Finished in 49.988 seconds

[22:50:14] I/launcher - 0 instance(s) of WebDriver still running
[22:50:14] I/launcher - chrome #01 failed 1 test(s)
[22:50:14] I/launcher - overall: 1 failed spec(s)
[22:50:14] E/launcher - Process exited with error code 1

webdriver-manager server log:

$-> webdriver-manager start
[22:49:18] I/start - java -Djava.security.egd=file:///dev/./urandom -Dwebdriver.gecko.driver=/home/mmmendonca1/.nvm/versions/node/v16.13.0/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.30.0 -Dwebdriver.chrome.driver=/home/mmmendonca1/.nvm/versions/node/v16.13.0/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_96.0.4664.45 -jar /home/mmmendonca1/.nvm/versions/node/v16.13.0/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar -port 4444
[22:49:18] I/start - seleniumProcess.pid: 726087
22:49:18.408 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
22:49:18.446 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444
2021-11-30 22:49:18.466:INFO::main: Logging initialized @163ms to org.seleniumhq.jetty9.util.log.StdErrLog
22:49:18.587 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
22:49:18.633 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
22:49:23.758 INFO [ActiveSessionFactory.apply] - Capabilities are: {
  "browserName": "chrome",
  "count": 1
}
22:49:23.759 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 96.0.4664.45 (76e4c1bb2ab4671b8beba3444e61c0f17584b2fc-refs/branch-heads/4664@{#947}) on port 29048
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
22:49:24.203 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C
22:49:24.247 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session 1169620a0503e3bca82b215a0e73be70 (org.openqa.selenium.chrome.ChromeDriverService)
22:50:14.346 INFO [ActiveSessions$1.onStop] - Removing session 1169620a0503e3bca82b215a0e73be70 (org.openqa.selenium.chrome.ChromeDriverService)
marconemm commented 2 years ago

Hi folks! Today, I tried to do the same thing that I did yesterday (even a single comma I didn't write in my script), and the Protractor worked pretty fine.

I'm closing this issue.

refactoreric commented 2 years ago

Hi @marconemm, please be aware that Protractor is dead/no longer maintained. Official end of life is at the end of 2022, but I have seen no activity from the maintainers for many months already. And even before that the project has been quite inactive for many years.

I would not recommend starting with/learning Protractor unless you have a large suite of existing tests written by others that you need to support. See https://github.com/angular/protractor/issues/5502 for an explanation and information about alternatives.

marconemm commented 2 years ago

Thanks, @refactoreric. I'm already dealing with the WebdriverIO. But is sad to know that Protractor is dead/no longer maintained.

See U.

StanislavKharchenko commented 2 years ago

It's a shame that @angular maintainers don't answer for user's questions. They scheduled EOL till 2022 - then they need to support users.

I'm total don't recommend users to rely on any @angular solutions, including Angular. If you don't want to have business issues - avoid @angular.