Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Protractor doesn't support angular synchronization on iOS #2840

Open

Description

@barmy-tester

This issue is similar to #1736

I cannot run my tests on iOS real device using appium and protractor. Tests fail each time with following errror: 'ERROR running appium command: Cannot assign to read only property X of true' where X is 'random' digit.
I've tried many configuration varieties, etc. and still got the same error.
The only workaround is to turn of synchronization by adding ignoreSynchronization=true to my tests. But with such workaround there is no point to use protractor anymore.

Here are instructions to integrate iOS with Safari, Appium and protractor:

  • git clone appium
  • intialize appium by running:

    ./reset.sh --ios --real-safari --profile '34e19aa1-xxxx-xxxx-xxxx-xxxxxxxxx' --verbose

  • run webproxy:

    ./bin/ios-webkit-debug-proxy-launcher.js -cXXXXXXXXXXXXXXX -d

  • start appium server:

    node lib/server/main.js -U XXXXXXXXXXXXXXXXXXXXXXXXXXX

  • run test by executing:

    protractor test.conf.js

You can find test.conf.js, appium console output and protractor console output in attached.
I've also tried to run tests with selenium grid by registering iOS node and the result was the same

Versions:

  • OSX El Capitan, 10.11.12
  • Xcode 7.2
  • Appium 1.4.16
  • Protractor 3.0.0
  • node 5.4.0
  • npm 3.3.12
  • DUT iOS version 9.2

If you need any additional information please let me know.

Just FYI, I can successfully run the same script with similar configuration on Windows - IE, Firefox, Chrome and Android - Chrome - real device

appium_output.txt
protractor_output.txt
test.conf.js.txt

Activity

  1. juliemr commented on Jan 15, 2016

    @juliemr
    Contributor

    Assigning to @sjelin - we're hoping to refresh mobile docs/setup soon.

  2. ivarcegeka commented on Feb 29, 2016

    @ivarcegeka

    I have the same problem. I have a simple cordova application and some simple tests. The tests work perfectly in the browser and on Android, but in iOS I get the error: 'Failed: ERROR running Appium command: Cannot assign to read only property '1' of true'. I will attach the protractor config and the test.
    I'm starting appium from the Appium.app. The only setting I changed from the default settings is that I checked 'use native instruments'.

    Am I doing something wrong or is this a bug?

    protractor-ios.config.txt
    uitest.spec.txt
    appium_log.txt
    protractor_log.txt

  3. wswebcreation commented on Feb 29, 2016

    @wswebcreation
    Contributor

    Did you got this working on iOS simulator?
    We faced the same problem, but in our opinion it's more a Appium issue then a Protractor issue. It looks like the returnedFromExecuteAtom is forcing a 'stop for alerts'. appium/lib/devices/ios/ios-controller.js:692

    We are looking into it further

  4. ivarcegeka commented on Feb 29, 2016

    @ivarcegeka

    Nope, not yet.

  5. ivarcegeka commented on Feb 29, 2016

    @ivarcegeka

    I upgraded my Appium version to 1.5 (from 1.4.13) and now I don't get those errors anymore. I get different errors though. It seems as if the click doesn't work, but that is a different problem.

  6. premkh9 commented on Mar 8, 2016

    @premkh9

    I am using Appium 1.4.13 and Xcode 7.2 but I am not able to execute any of my tests in IOS simulator. Issue persists in Sauce labs emulator as well

    Job Details - https://saucelabs.com/beta/tests/f3bb551a0daf4f5d9d867b71e9b29657
    multiCapabilities: [{
    'browserName': 'Safari',
    'appium-version': '1.4.13',
    platformName: 'iOS',
    platformVersion: '9.2',
    deviceName: 'iPhone 6 Plus',
    'name': 'Protractor Job',

  7. teddyhwang commented on Mar 15, 2016

    @teddyhwang
  8. premkh9 commented on Mar 15, 2016

    @premkh9

    Hi Sjelin, any resolution to resolve the issue

  9. sjelin commented on Mar 15, 2016

    @sjelin
    Contributor

    Yeah, I'm working on it. Hopefully I'll have something in next week, but we'll see.

  10. premkh9 commented on Apr 4, 2016

    @premkh9

    Hi Sjelin, Hope you are doing good ! Did you get a chance to look into the issue?

  11. sjelin commented on Apr 7, 2016

    @sjelin
    Contributor

    I did! I got wrapped up in other things though. Hopefully before the end of this week I'll have something for you 😄

  12. barmy-tester commented on May 6, 2016

    @barmy-tester
    Author

    Any news?

  13. 9 remaining items

  14. wswebcreation commented on Dec 22, 2016

    @wswebcreation
    Contributor

    I currently use protractor and iOS Safari in 3 different combinations and it works:

    • appium + iOS 10.2 simulator + Safari
    • Saucelabs + iOS 10.2 simulator + Safari
    • Perfecto + (iPhone 5C / iPhone 6S / iPhone 7) + Safari

    The first 2 are simulators, Perfecto has physical devices

    @sjelin, if you need help with this I can maybe help to debug it if there are problems

  15. sjelin commented on Dec 22, 2016

    @sjelin
    Contributor

    @wswebcreation thanks for the offer! I'll let you know

  16. luiscspinho commented on Jan 31, 2017

    @luiscspinho

    Hello,
    I just faced this problem. I'm trying to automate Safari with iOS 10.0.1 using Appium and Protractor.
    I've everything working just fine if I do something like this:

    browser.ignoreSynchronization = true;
    browser.get('https://myAngularPage.com');
    browser.wait(protractor.until.elementLocated(by.css('.class')), 5000);
    element.click()
    

    However, since I've an angular page I should not need to ignoreSync and wait for the element to be visible to click on him. I've this working on Android/Chrome without the ignoreSync and the wait until element located. However, in Safari/iOS, if i don't add the ignoreSynch before the browser get, the website will be stuck on the bootstrap throwing the "angular never provided resumebootstrap" with just the "browser.get()" code on my test.

    Is this the same issue that angular and iOS/Safari are not yet fully supported?

  17. sjelin commented on Feb 8, 2017

    @sjelin
    Contributor

    It's still not fully supported, no. Unfortunately, I was in charge of mobile support and I was just transferred to another team, so support may be a long time coming. There are some good resources online though

  18. jlin412 commented on Feb 8, 2017

    @jlin412

    It's funny. I have it worked in iOS but not in Android. Just opposite of your problem.

  19. reppners commented on Mar 30, 2017

    @reppners

    Trying to get tests to run in mobile safari with Appium / iOS simulator / 10.3 but also getting angular never provided resumeBootstrap.

    Safari 10.1 on macOS Sierra seems to be working with this workaround but would throw the same error otherwise.

    // TODO workaround for https://github.com/angular/protractor/issues/4004
    if (navigator.webdriver) {
        window.name = "NG_DEFER_BOOTSTRAP!" + window.name;
    }
    
    angular.bootstrap();
    

    EDIT:

    Ok, so specifying this

    // TODO workaround for https://github.com/angular/protractor/issues/4004
    
    window.name = "NG_DEFER_BOOTSTRAP!" + window.name;
    
    angular.bootstrap();
    

    will let angular synchronize with Safari running in iOS simulator. I don't know any global browser variable for Appium to set this line conditionally. If anyone does pls let me know 👍

  20. BorntraegerMarc commented on Oct 27, 2017

    @BorntraegerMarc

    @sjelin does this issue present itself only when combined with appium or also if the "normal" iOS safari driver is used?

  21. wswebcreation commented on Oct 27, 2017

    @wswebcreation
    Contributor

    @BorntraegerMarc

    What do you exactly mean? the iOS safari driver is used by Appium (?)

  22. BorntraegerMarc commented on Oct 27, 2017

    @BorntraegerMarc

    @wswebcreation I mean writing protractor tests without appium 😄 just protractor tests for a angular website...

  23. FreshQa commented on Oct 27, 2017

    @FreshQa

    Safari 10.3 & 11.0 do not work with Protractor, however on Sierra macOS running Safari 11.0.1 does. Just turn off synchronization right before your first browser.get call and immediately turn it back on following that first call, then you're good to go.

  24. wswebcreation commented on Oct 28, 2017

    @wswebcreation
    Contributor

    @FreshQa

    Tnx for your answer / workaround, will also try it.

  25. firstor commented on Oct 28, 2017

    @firstor

    Can anyone help me with the following error?

    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
    
    • Protractor: v5.1.2
    • Protractor configuration:
      seleniumAddress: 'http://hub-cloud.browserstack.com/wd/hub',
      baseUrl: 'http://localhost:5001',
      ...
      capabilities: {
          'name': 'Safari on iPhone',
          'device': 'iPhone 7 Plus',
          'realMobile': 'true',
          'os': 'ios',
          'os_version': '10.3',
          'browserName': 'iPhone',
          'browserstack.local': true,
          'browserstack.debug': true
      }
      
  26. removed their assignment
    on Sep 20, 2019
  27. evilaliv3 commented on Jun 5, 2020

    @evilaliv3
    Contributor

    Have anyone found a solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions