如何在TestCafe中找到使用动态选择器的输入字段

我尝试使用testcafe创建端到端测试,该测试在特定字段运行失败时会填写表格,因为找不到选择器。

我正在使用以下代码行来查找并尝试更新字段

.typeText('#formControl363','1.25.1979');

这是下面的元素

<input type="text" class="form-control_date ng-isolate-scope form-control form-control_s form-control_color-blue ng-touched ng-dirty ng-valid-date ng-invalid ng-invalid-required ng-valid-date-in-range" ng-class="cssClass" ng-model="ngModel" ng-required="ngRequired()" ng-disabled="ngDisabled()" uib-datepicker-popup="" popup-placement="auto bottom-left" is-open="status.isOpened" ng-click="status.isOpened=true" datepicker-options="datepickerOptions" datepicker-append-to-body="appendToBody !== false" placeholder="Select Date" id="formControl363" required="required">

右键单击该元素并复制选择器,即可得到#formControl363

1) The specified selector does not match any element in the DOM tree.

       > | Selector('#formControl363')
s1376655 回答:如何在TestCafe中找到使用动态选择器的输入字段

您需要使用其他方式来选择元素:页面层次结构,类选择器,属性选择器等。 在TestCafe支持中心中查看类似的问题:

本文链接:https://www.f2er.com/3134908.html

大家都在问