我试图从日期选择器中选择当前日期,但是当我从日期按钮单击时,量角器测试失败。收到此错误
Message:
Failed: unknown error: Element <input _ngcontent-c18="" class="mat-input-element mat-form-field-autofill-control cdk-text-field-autofill-monitored ng-untouched ng-pristine ng-invalid" formcontrolname="fromDate" id="fromDate" matinput="" placeholder="From Date" readonly="" aria-haspopup="true" max="2018-09-25" aria-invalid="false" aria-required="false"> is not clickable at point (517, 268). Other element would receive the click: <div class="mat-form-field-infix">...</div>
(Session info: chrome=68.0.3440.75)
(Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.10.0-28-generic x86_64)
日期选择器的html代码是
答案 0 :(得分:0)
如果将==$0
这样放置,您的方法将起作用:
<div class="mat-form-field-infix">
<input...></mat-datapicker> ==$0
尝试将密钥直接发送到<div class="mat-form-field-infix">