0
votes

I am using Protractor with Jasmine2 and e2e execution performs on Browserstack.

Execution for E2E has almost 60 specs file - Each Spec file has around ~10 it()

All specs are passed through comma separated list for eg a,b,c,d etc

If timeout error appears due to some inconsistency for lets say spec b then execution of c & d never resumes and error appears in the log such as (node:67941) UnhandledPromiseRejectionWarning: WebDriverError: Session not started or terminated

Then below error 10:59:45 From asynchronous test: 10:59:45 Error 10:59:45 at Jasmine2Reporter.jasmineStarted (PATH_TO_FOLDER/node_modules/protractor-beautiful-reporter/index.js:4948:13) 10:59:45 at dispatch (PATH_TO_FOLDER/node_modules/protractor/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4366:28) 10:59:45 at ReportDispatcher.jasmineStarted (PATH_TO_FOLDER/node_modules/protractor/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4337:11) 10:59:45 at Env.execute (PATH_TO_FOLDER/node_modules/protractor/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:975:16) 10:59:45 at Jasmine.execute (PATH_TO_FOLDER/node_modules/protractor/node_modules/jasmine/lib/jasmine.js:200:12) 10:59:45 at PATH_TO_FOLDER/node_modules/protractor/built/frameworks/jasmine.js:132:15 10:59:45 at Function.promise (PATH_TO_FOLDER/node_modules/protractor/node_modules/q/q.js:682:9) 10:59:45 at PATH_TO_FOLDER/node_modules/protractor/built/frameworks/jasmine.js:104:14 10:59:45 at _fulfilled (PATH_TO_FOLDER/node_modules/protractor/node_modules/q/q.js:834:54) 10:59:45 From: Task: Run beforeEach in control flow 10:59:45 at UserContext. (PATH_TO_FOLDER/node_modules/jasminewd2/index.js:94:19) 10:59:45 at attempt (PATH_TO_FOLDER/node_modules/protractor/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4297:26) 10:59:45 at QueueRunner.run (PATH_TO_FOLDER/node_modules/protractor/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4217:20) 10:59:45 at QueueRunner.execute (PATH_TO_FOLDER/node_modules/protractor/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4199:10) 10:59:45 at Spec.queueRunnerFactory (PATH_TO_FOLDER/node_modules/protractor/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:909:35) 10:59:45 at Spec.execute (PATH_TO_FOLDER/node_modules/protractor/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:526:10) 10:59:45 at UserContext.fn (PATH_TO_FOLDER/node_modules/protractor/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:5340:37) 10:59:45 at attempt (PATH_TO_FOLDER/node_modules/protractor/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4297:26) 10:59:45 at QueueRunner.run (PATH_TO_FOLDER/node_modules/protractor/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4217:20) 10:59:45 at runNext (PATH_TO_FOLDER/node_modules/protractor/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4257:20)

In spec file we are using beforeAll()to initiate browser for every spec wise

Any help here will be appreciatated

NOTE - timeout error is triggered from Browserstack which has default timeout of 90 seconds and script continue to try to send request

1

1 Answers

0
votes

It seems like the timeout is causing the error messages. Browserstack defaults the timeout to 90 seconds in case you do not explicitly state the duration.

If you believe that the timeout needs to be increased, Browserstack provides a capability to achieve the same:

'browserstack.idleTimeout': 300

The value can go up to maximum 300 seconds.

you can check the capability page here: https://www.browserstack.com/automate/capabilities