protractor-beautiful-reporter icon indicating copy to clipboard operation
protractor-beautiful-reporter copied to clipboard

Unexpected Alerts, script timeouts, invalid session id failures not reported

Open potej opened this issue 4 years ago • 2 comments

Hi,

When test runs fail because of one of the following reasons, protractor-beautiful-reporter does not show them in the report at all:

  1. Unexpected Alerts
  2. script timeouts
  3. invalid session id failures

However, protractor-html-reporter does show them in their report (but thats not beautiful) image

Example 1: UnexpectedAlertOpenError: unexpected alert open: {Alert text : Communication error!} (Session info: chrome=81.0.4044.129) (Driver info: chromedriver=81.0.4044.20 (f006328e39a9769596eb506c8841c3004b24e747-refs/branch-heads/4044@{#244}),platform=Windows NT 10.0.17134 x86_64) Stack: UnexpectedAlertOpenError: unexpected alert open: {Alert text : Communication error!} (Session info: chrome=81.0.4044.129) (Driver info: chromedriver=81.0.4044.20 (f006328e39a9769596eb506c8841c3004b24e747-refs/branch-heads/4044@{#244}),platform=Windows NT 10.0.17134 x86_64) at Object.checkLegacyResponse (C:\Users...\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:553:13) at parseHttpResponse (C:\Users...\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:509:13) at doSend.then.response (C:\Users...\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:441:30) at process._tickCallback (internal/process/next_tick.js:68:7) From: Task: WebDriver.takeScreenshot() at thenableWebDriverProxy.schedule (C:\Users...\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:807:17) at thenableWebDriverProxy.takeScreenshot (C:\Users...\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:1085:17) at run (C:\Users...\AppData\Roaming\npm\node_modules\protractor\built\browser.js:59:33) at ProtractorBrowser.to.(anonymous function) [as takeScreenshot] (C:\Users...\AppData\Roaming\npm\node_modules\protractor\built\browser.js:67:16) at D:...\node_modules\protractor-jasmine2-screenshot-reporter\index.js:600:23 at D:...\node_modules\lodash\lodash.js:4905:15 at baseForOwn (D:...\node_modules\lodash\lodash.js:2990:24) at D:...\node_modules\lodash\lodash.js:4874:18 at Function.forEach (D:...\node_modules\lodash\lodash.js:9342:14) at Jasmine2ScreenShotReporter.specDone (D:...\node_modules\protractor-jasmine2-screenshot-reporter\index.js:596:7)

potej avatar May 08 '20 15:05 potej

Example 2: Failed: unknown error: session deleted because of page crash from unknown error: cannot determine loading status from tab crashed (Session info: chrome=81.0.4044.129) (Driver info: chromedriver=81.0.4044.20 (f006328e39a9769596eb506c8841c3004b24e747-refs/branch-heads/4044@{#244}),platform=Windows NT 10.0.17134 x86_64) Stack: WebDriverError: unknown error: session deleted because of page crash from unknown error: cannot determine loading status from tab crashed (Session info: chrome=81.0.4044.129) (Driver info: chromedriver=81.0.4044.20 (f006328e39a9769596eb506c8841c3004b24e747-refs/branch-heads/4044@{#244}),platform=Windows NT 10.0.17134 x86_64) at Object.checkLegacyResponse (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:546:15) at parseHttpResponse (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:509:13) at doSend.then.response (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:441:30) at process.tickCallback (internal/process/next_tick.js:68:7) From: Task: Protractor.waitForAngular() - Locator: By(css selector, .no-button) at thenableWebDriverProxy.schedule (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:807:17) at ProtractorBrowser.executeAsyncScript (C:\Users\AppData\Roaming\npm\node_modules\protractor\built\browser.js:425:28) at angularAppRoot.then (C:\Users\AppData\Roaming\npm\node_modules\protractor\built\browser.js:456:33) at ManagedPromise.invokeCallback_ (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1376:14) at TaskQueue.execute_ (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3084:14) at TaskQueue.executeNext_ (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3067:27) at asyncRun (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2927:27) at C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:668:7 From: Task: Run it("Init") in control flow at UserContext. (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:94:19) at C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:64:48 at ControlFlow.emit (C:\Users...\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\events.js:62:21) at ControlFlow.shutdown_ (C:\Users...AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2674:10) at shutdownTask_.MicroTask (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2599:53) From asynchronous test: Error at Suite. (D: \FanTest.js:1082:5) at Object. (D:\ FanTest.js:1081:1) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12)

Example 3: Message: NoSuchSessionError: invalid session id at Object.throwDecodedError (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:514:15) at parseHttpResponse (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:519:13) at doSend.then.response (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:441:30) at process._tickCallback (internal/process/next_tick.js:68:7) From: Task: WebDriver.takeScreenshot() at thenableWebDriverProxy.schedule (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:807:17) at thenableWebDriverProxy.takeScreenshot (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:1085:17) at run (C:\Users\AppData\Roaming\npm\node_modules\protractor\built\browser.js:59:33) at ProtractorBrowser.to.(anonymous function) [as takeScreenshot] (C:\Users\AppData\Roaming\npm\node_modules\protractor\built\browser.js:67:16) at D:\node_modules\protractor-jasmine2-screenshot-reporter\index.js:600:23 at D:\node_modules\lodash\lodash.js:4905:15 at baseForOwn (D:\node_modules\lodash\lodash.js:2990:24) at D:\node_modules\lodash\lodash.js:4874:18 at Function.forEach (D:\node_modules\lodash\lodash.js:9342:14) at Jasmine2ScreenShotReporter.specDone (D:\node_modules\protractor-jasmine2-screenshot-reporter\index.js:596:7)

potej avatar May 08 '20 20:05 potej

Regarding the unecpected alert thing;: I think you need to adjust your tests like this: https://stackoverflow.com/questions/19173195/how-to-handle-the-unexpected-alert-open else the alert is blocking protractor

miller45 avatar Aug 24 '22 14:08 miller45