-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Cannot read property '$$testability' of undefined #4233
Comments
By default, it wasn't returning anything. Now it returns a promise that resolves to internalAngularAppRoot. Fixes angular#4233
By default, it wasn't returning anything. Now it returns a promise that resolves to internalAngularAppRoot. Fixes #4233
Do we have an ETA on when this will be pushed into the npm package for an easy npm update? |
ooohhhhh....that's why I can't create an issue using the protractor test app (v1 angular)! Because the test app has the ng-app attribute on the html element. http://www.protractortest.org/testapp/ng1/#/form I'd think you could add some regression tests in the protractor suite against protractortest.org website, to help avoid issues like these in the future. Good luck! +1 on getting a 5.1.2 release (so that we can create more issues for you to review! Thanks Protractor team, you're doing a great job!!!!) |
Is there any update on implementing this into the next version? Or at least a fix we can make on our end while we wait for it to be pushed? |
We're planning to do a 5.1.2 tomorrow that should include this fix. |
@heathkit Thank you very much!! |
When is the release of 5.1.2 and why is this issue closed. I keep getting this error all the time.. :( |
@avinashs15 You can build from source by following these directions. After you run |
If anyone is still seeing this issue in 5.1.2, could you please reopen with an example that reproduces the problem? Thanks. |
Hi Contributors, Any updates around this issue . Using protractor version 5.1.2 doesn't resolve this issue. Thank you for your help. |
Using Protractor 5.1.2 we also have 'Error while waiting for protractor to sync with the page: "Cannot read property $$testability of undefined."' |
For those of you still seeing this problem, please post your Protractor config. I'm specifically interested in whether you set rootElement. A github repo or plunkr that demonstrates the problem would be very helpful. |
Protractor config, as requested:
Bootstrapping using upgrade module like this:
|
Hi Contributors,
Thanks for your help. |
Using Protractor 5.1.2 i have 'Error while waiting for protractor to sync with the page: "Cannot read property $$testability of undefined."' |
Also facing the same issue. |
Those who have responded since this issue has been resolved have either:
This issue was specifically related to |
Hi @benharold Thank you for your response. Any thoughts ?Thanks again. |
@tarunkumbnani It looks like this pull request may be related to the issue. |
Hi @benharold I'm still experiencing this problem while using [email protected]. I have explicitly set the root element in the config and still get the problem. My config is below:
In my suite of 62 tests some pass and some fail. It appears to be random which ones pass and which fail. The error messages are: Any advice? |
@divercraig I'm guessing that |
Hi - Is this still an issue for some people? If you are having issues with Protractor and your hybrid app, can you post the following from Chrome devtools console for your app?
|
window.getAllAngularTestabilities |
Running protractor 5.1.2. I am getting error
@divercraig did you resolve the issue? |
@webdeveloperninja no I haven't resolved this problem. I'm only seeing it intermittently on my tests which is very annoying |
ha get that. @vikerman I am still struggling with this. bellow are those 3 commands outputs
|
Can you provide us with an example project in which you also have the scripts to reproduce this issue? I'm working with Protractor 5.1.2 and Angular 4.x and don't have any problems |
Hi there, protractor version: 5.1.2 Config file: exports.config = {
seleniumServerJar: 'seleniumServer/selenium-server-standalone-3.5.0.jar',
getPageTimeout: 15000,
allScriptsTimeout: 50000,
defaultTimeoutInterval: 15000,
includeStackTrace: true,
rootElement: 'body',
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
specs: [
'Tests/Features/*.feature'
],
cucumberOpts: {
require: [
'Tests/Steps/*.js' // accepts a glob
],
format: ['json:reports/results.json', 'pretty'],
profile: false,
'no-source': true
},
capabilities: {
'browserName': 'Chrome'/*,
chromeOptions: {
args: ["--headless", "--disable-gpu", "--window-size=800x600"]
}*/
},
params:{
environment: 'test',
environments:{
dev:{
mainPage: 'http://google.com',
dashboardPage: 'https://angular.io/'
},
test:{
mainPage: 'http://google.com',
myITpage: 'https://angularjs.org/',
dashboardPage: 'https://angular.io/'
},
prod:{
mainPage: 'http://google.com',
myITpage: 'https://angularjs.org/',
dashboardPage: 'https://angular.io/'
}
}
}
}; window.getAllAngularTestabilities
undefined
window.getAngularTestability
undefined
window.angular.version
{full: "1.6.4", major: 1, minor: 6, dot: 4, codeName: "phenomenal-footnote"} Is there anything else I need to provide? |
You are using |
@wswebcreation, I'm getting the same error with removed |
@PE-test |
@wswebcreation, it is failing on https://angularjs.org/, when trying to get the page for the second time. |
Tnx, Will check it later today. What's the command you use to run Protractor in this project |
@wswebcreation |
Got half of it working on my machine (Mac OSX 10.12.6) but my internet connection is not that good (not at home). Will take look at it again next week when I'm home. The first tests, on the angularJS site works. Only difference what I can see now (not that it is the core of the problem) is that I have Protractor as a project dependency and based on your provided project it is a global dependency. |
There are a few errors in your script. You log and return promises before they are resolved, and there are some undefined errors in your script. Example: getPlaceholderText: function(){
var angular = this.angularHomepage;
var placeholderText;
// angular.inputField => is undefined
angular.inputField.getAttribute('placeholder').then(function (placeholder){
placeholderText = placeholder;
});
console.log("Debug: "+placeholderText);
// Already returned before the Promise is resolved
return placeholderText;
} I get the error you have with |
Hi, having the same problem with version 5.1.2. My config:
I found that changing specs to single files instead of a glob, the error goes away:
Hope this helps! |
I had to add the following code to get rid of
then had to increase browser.sleep
in order to fix
So it seems like Angular isn't initialised properly yet |
Facing the issue with version 5.1.2 Here is my config File: exports.config = { seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['test_protractor3.js'], |
Hi All, |
Hey, how to solve this problem? |
We are experiencing similar kind of problems that we think they are related with testability api. In previous version of our app, for the elements in pages it is like; But after latest versions we are getting a "false" for the method above and protractor somehow lose the interactions with objects. We can operate on pages via using "browser.ignoreSynchronization = true;" on those pages. But we dont want to use this because of it is aganist control flow and async approach. So we try to figure out which changes one test enviroment result to this. If you have any idea i glad to hear. Thanks in advance. |
some times i am facing error of 'cannot read property click of undefined' while executing protractor scripts .can someone please guide that what is the cause of this error? |
In Protractor 5.1.1 if your Angular app has a root element other than
<body>
, you'll see the errorCannot read property '$$testability' of undefined
. This is because browser.angularAppRoot() is expected to return the current value of app root if a value isn't passed to it, but currently returns undefined.The text was updated successfully, but these errors were encountered: