Closed mindmelting closed 9 years ago
Using ignoreSynchronisation = true, now makes the app display and navigates a bit using my tests, but by.model calls now fail, which makes me think it now hasn't bootstrapped correctly?
I wonder if the by.model
issue is related to https://github.com/angular/protractor/issues/1632 (I thought it was only a problem with selendroid, but maybe appium/ios has an issue as well).
How does the by.model call fail?
It fails with this stackstrace when using
browser.manage().timeouts().implicitlyWait(25000);
browser.ignoreSynchronization = true;
NoSuchElementError: No element found using locator: by.model("user.officialAddress.zipCode")
Just using
browser.ignoreSynchronization = true;
will not find any elements
NoSuchElementError: No element found using locator: By.className("btn-primary")
OK just to make sure - you're absolutely sure that this item does in fact exist on the page? Have you tried putting in a sleep statement (I'm not sure if implicit wait will wait for custom element selectors, I will look into that and report back) before looking by model?
Yep, like I say the tests work perfectly on Android, it is only on iOS that this is an issue.
I will check when I get back into work tomorrow if the sleep statement makes a difference.
Thanks for your help :)
Any update?
@juliemr - I have a similar problem, my angular app is launched in browser using safari launcher on an iPad but when i'm trying to use element(by.) i get an error in appium that says something like this :+1: var el = document.querySelector(rootSelector);\n\n try {\n if (!window.angular) {\n throw new Error('angular could not be found on the window'); After that all the tests are blocked and the driver never quits. If i use browser.driver.findElement(by.) it works just fine. What do you think?
I haven't heard any updates on the original issue, so I'm closing this. Please open a fresh issue with a reproducible test case if you believe there is a bug with Protractor.
Hi @mindmelting could you please share what you've done for Android? In terms of what config.js
do you have and also what test are you doing? I'm facing similar issue here: http://stackoverflow.com/questions/30787588/using-protractor-appium-saucelabs
Thanks!!
I have the same problem. The app cannot launch. Adding browser.ignoreSynchronization = true
makes the first page load, but the next calls fail. Here is the appium log when it breaks
info: --> POST /wd/hub/session/bd7e1efe-0f5b-4af3-ae86-87a8a7aa5fe5/execute {"script":"return (function () {\n angular.module('protractorBaseModule_', []).\n config(['$compileProvider', function($compileProvider) {\n if ($compileProvider.debugInfoEnabled) {\n $compileProvider.debugInfoEnabled(true);\n }\n }]).\n config(['$provide', function($provide) {\n $provide.decorator('$timeout', ['$delegate', function($delegate) {\n var $timeout = $delegate;\n\n var taskId = 0;\n if (!window.NG_PENDING_TIMEOUTS) {\n window.NG_PENDING_TIMEOUTS = {};\n }\n \n var extendedTimeout = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof(args[0]) !== 'function') {\n return $timeout.apply(null, args);\n }\n\n taskId++;\n var fn = args[0];\n window.NG_PENDING_TIMEOUTS[taskId] = fn.toString();\n var wrappedFn =
info: <-- POST /wd/hub/session/bd7e1efe-0f5b-4af3-ae86-87a8a7aa5fe5/execute 500 2.240 ms - 101
TypeError: Cannot assign to read only property '4' of true
Protractor tests work fine on Android, but with Appium on iOS it uses SafariLauncher and navigates to my angular app, but it never seems to load the app and I just get a gray screen. If I hit refresh the app loads fine though.
The angular app uses requirejs and is manually bootstrapped to a div element, so I configure rootElement in my configuration.
If I use java to write tests, they run fine and the app launches...hence I think it is a Protractor issue...
This is the logs that get output from my selenium grid instance...