element.getAttribute('value') 在量角器中返回 null [英] element.getAttribute('value') returns null in Protractor

查看:53
本文介绍了element.getAttribute('value') 在量角器中返回 null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

element.getAttribute('value') 在量角器中返回 null,尽管在源代码中存在值的详细信息.

element.getAttribute('value') returns null in Protractor, although in source code the value details are present.

下面是我的代码,

console.log(await this.textArea.getAttribute('value'));

console.log(await this.textArea.getAttribute('value'));

源代码图片

我阅读了有关同一问题的其他帖子,但这些帖子都很旧,没有任何解决方案适合我.我还尝试使用 browser.actions().click(element).sendKeys('input').perform(); 输入输入.考虑可能是 sendKeys() API 问题,但仍然没有运气.

I read other posts around the same issue, but those are old and no solution is working for me. I also tried for entering input with browser.actions().click(element).sendKeys('input').perform(); thinking of it could be sendKeys() API issue but still no luck.

同样的代码element.getAttribute('value')"一直工作到 2021 年 6 月 1 日都很好,突然返回空值,不确定是否有任何代码更改或编译器版本需要更新?

And the same code "element.getAttribute('value')" was working perfectly fine till 1st June 2021 and suddenly returning null value, not sure if there are any code changes or compiler version needs to be updated?

推荐答案

这不是问题的答案,而是找到了最新 Chrome 版本 91.0.4472.77 的 element.getAttribute('value') 方法.它还提供了完整日历角度组件的问题.https://github.com/fullcalendar/fullcalendar/issues/6343

This is not an answer to the question but found the root cause that the latest Chrome version 91.0.4472.77 is having an issue with the element.getAttribute('value') method. It is also giving an issue with Full calendar angular component. https://github.com/fullcalendar/fullcalendar/issues/6343

我可以在 Microsoft Edge 版本 91.0.864.37 浏览器上运行我的测试.

I'm able to run my tests on Microsoft Edge Version 91.0.864.37 browser.

这篇关于element.getAttribute('value') 在量角器中返回 null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆