browserstack / browserstack-local-nodejs

NodeJS bindings for BrowserStack Local
https://www.browserstack.com
MIT License
71 stars 56 forks source link

Error running Protractor : "Error while running testForAngular: Unable to communicate to node" #40

Open firstor opened 7 years ago

firstor commented 7 years ago

I got the error while running Protractor tests on the BrowserStack.

warning From Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarded as-is to the scripts.
$ tsc -p e2e/tsconfig.e2e.json && protractor e2e/build/protractor.config.js
[06:26:44] W/driverProviders - Using driver provider hosted, but also found extra driver provider parameter(s): browserstackUser, browserstackKey
[06:26:44] I/launcher - Running 1 instances of WebDriver
[06:26:44] I/hosted - Using the selenium server at http://hub-cloud.browserstack.com/wd/hub
[06:27:00] W/runner - Ignoring unknown extra flags: target. This will be an error in future versions, please use --disableChecks flag to disable the  Protractor CLI flag checks.
...
Error: Error while running testForAngular: Unable to communicate to node
    at executeAsyncScript_.then (/home/workspace/project/node_modules/protractor/lib/browser.ts:945:27)
    at ManagedPromise.invokeCallback_ (/home/workspace/project/node_modules/selenium-webdriver/lib/promise.js:1366:14)
    at TaskQueue.execute_ (/home/workspace/project/node_modules/selenium-webdriver/lib/promise.js:2970:14)
    at TaskQueue.executeNext_ (/home/workspace/project/node_modules/selenium-webdriver/lib/promise.js:2953:27)
    at asyncRun (/home/workspace/project/node_modules/selenium-webdriver/lib/promise.js:2813:27)
    at /home/workspace/project/node_modules/selenium-webdriver/lib/promise.js:676:7
    at process._tickCallback (internal/process/next_tick.js:109:7)
[ERROR] Error: Error: Error while running testForAngular: Unable to communicate to node
    at /home/workspace/project/e2e/build/specs/home.spec.js:17:19
    at process._tickCallback (internal/process/next_tick.js:109:7)
[05:43:16] E/launcher - Process exited with error code 1

Could you help me solve the issue?

ashwingonsalves commented 7 years ago

I understand you are seeing the failure only while testing on iOS devices.

Protractor injects JavaScripts using execute_async method. The execute_async method is not fully supported by Appium. Thus, you may not receive a valid response. This probably results in the failures you are seeing while testing on iOS devices.

At the moment, there is no workaround to the issue unless fixed in Appium.