-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'className' of undefined #2099
Comments
This behavior looks like regression. To find the cause of the problem, we need to have a website on which we can reproduce this behavior. Also, we need test code that leads to errors in the browser console. |
Hi @miherlosev Thanks for your quick reply. Unfortunately, we couldn't easily create an example to mimic the problem. So I caught up with one of our Developers which helped me to debug the issue a bit more and here are some additional information: Looks like the problem is somewhere around Kendo UI Validator and hammerhead (apparently nothing to do with the promise-button as we initially thought). We're using Kendo UI v2015.2.727 (http://www.telerik.com/kendo-ui) to validate the input fields in the forms. Kendo validator is going through elements in the page and checking the className which throws the following Console Error (right after TestCafe clicks on the button):
By putting a debugger, we managed to pinpoint that the failure is happening on the following line of kendo.all.min.js (because i is undefined when accessing className):
The component button on our page looks like this:
The TestCafe code that interacts with the button above does only a simple click (nothing else). Here is the exact code we're using:
Friendly reminder: all works fine with TestCafe 1.1.0. Issue occurs with all newest versions. We'd highly appreciate your help on this as we'd like to use latest version of TestCafe. Thank you! |
Hello, I found the "Validator / AngularJS" example, and I don't see any " import { Selector } from 'testcafe';
fixture `Fixture`
.page `https://demos.telerik.com/kendo-ui/validator/angular`;
test('Click submit button', async t => {
await t.click(Selector('#fieldlist > li.confirm > button'), { speed: 0.2 });
}); Result
Could you please provide us with steps to reproduce the issue on our side based on the "Validator / AngularJS" example (or on your own example)? |
Hi @Farfurix, I tried your example above and all works fine here for me on latest TestCafe too. Unfortunately, I cannot give you access to our Test Environment (and we were not successful generating a code example) But I'm more than happy to do a quick call/screen-share to walk you through the issue. Can I get a DevExpress email/contact so we can organise a quick screen share? //cc @miherlosev We really want to get through this issue to be able to use latest TestCafe. Appreciate your help. |
Hi @rodrigotolledo , We don't provide such remote service at the moment. Please check if the problem is reproducible in one of the following testcafe versions:
Could you please provide us with the earliest version in which you can reproduce the issue? This will help us localize the changes where the regression was made. |
Hi @aleks-pro, Good idea! Here are the results of my tests:
Let me know if you need any additional info. Appreciate your help! Cheers! |
Thank you for your clarification. We have an assumption: the issue relates to the For team: <html>
<head></head>
<body>
<form kendo-validator="validator" ng-submit="validate($event)" class="ng-pristine ng-valid" data-role="validator" novalidate="novalidate" __bizdiag="1800080961" __biza="WJ__">
<ul id="fieldlist">
<li>
<label for="fullname" class="required">Your Name</label>
<input type="file" name="file" id="file">
<input type="text" id="fullname" name="fullname" class="k-textbox sessioncamexclude" placeholder="Full name" required="" validationmessage="Enter {0}" style="width: 220px;">
</li>
</ul>
</form>
<script>
function test() {
var form = document.querySelector('form');
console.log('form.getElementsByTagName(\'*\').length =', form.getElementsByTagName('*').length);
console.log('form.getElementsByTagName(\'*\') =', form.getElementsByTagName('*'));
console.log('last element =', form.getElementsByTagName('*')[form.getElementsByTagName('*').length - 1]);
}
setTimeout(test, 5000);
</script>
</body>
</html> Steps to reproduce the undefined
|
Hi @Farfurix, Thanks for looking into this issue. I can confirm we're using Let me know if you need any additional information. Thanks! |
After we fix the issue, you will be able to pass your test case with an updated |
Awesome, @Farfurix! I'll wait for the fix. Thank you! |
You are welcome. |
Input type="file" broke the automated testing with latest version of the testcafe |
The problem occurs if there is a form with |
I can quite easily reproduce.
If I remove the ng-if, it works. But it does not work if I put the ng-if outside in a div. |
Hi all, Just wondering if we have any idea when this issue will be addressed? Once this issue is fixed, we will finally be able to upgrade to latest TestCafe. Still stuck with version Feel free to hit me up if you need any additional details. Cheers! |
I cannot provide you with a precise time frame. The current development sprint is already planned. We will consider this issue during planning the next development sprint. |
Appreciate your help and effort on fixing this issue @LavrovArtem and @miherlosev! I can see this change is part of Just wondering how often you bump up the versions? (so testcafe will use latest hammerhead) Thanks again! |
@rodrigotolledo, |
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
What is your Test Scenario?
Hello!
I'm having a hard time to click on some old Angular JS components (buttons) when using most recent versions of TestCafe. Here is an example of a button that TestCafe cannot click:
<button class="uiid-onboard-employee-button btn btn-primary mg_r20 wd_160" promise-button="vm.saveAddEmployee()" > {{vm.saveButtonText}} </button>
I can only click on the button above when using TestCafe version
1.1.0
, I've tried several versions after this (including latest1.3.3
) but when TestCafe clicks on the button, nothing happens and the following error is thrown in my Chrome Console:I noticed that all buttons that I have issues have this
promise-button
attribute.What is the Current behavior?
Only TestCafe
1.1.0
can click on the buttons above.What is the Expected behavior?
I'd expect latest versions of TestCafe to be able to click successfully.
What is your web application and your TestCafe test code?
Your website URL (or attach your complete example):
Your complete test code (or attach your test files):
Your complete configuration file (if any):
Your complete test report:
Screenshots:
Steps to Reproduce:
Your Environment details:
The text was updated successfully, but these errors were encountered: