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

标签 testing dynamic css-selectors automated-tests 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')

最佳答案

关于testing - 如何在 TestCafe 中找到使用动态选择器的输入字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58774248/

相关文章:

javascript - MooTools:将事件附加到多个元素

xcode - UITableView 变得无响应

javascript - 从表中获取属性 - Protractor

ios - 在 iOS 上点击行为与 disableSynchroniztion 不一致

html - 相邻的同级选择器对我的标记不起作用

c - 在 C 中的结构内定义结构数组

javascript - Vue2动态输入名称

scala - 如何在 expect() 中看到错误值时生成 [error] 而不是 [info]

java - 如何在camel测试中配置application.properties?

java - 新的Object.getClass()