Dom*_*ála 9 javascript automated-tests cypress
我在自动测试中输入某个字段时遇到问题。\n我无法获取该字段,但我不知道为什么。
\n这是我的代码:
\ncy.get(\'#reasonRecommendationByAgent\')\n .type(\'Zd\xc5\xafvodn\xc4\x9bn\xc3\xad doporu\xc4\x8den\xc3\xad zprost\xc5\x99edkovatele\', {force: true})\n .should(\'have.value\', \'Zd\xc5\xafvodn\xc4\x9bn\xc3\xad doporu\xc4\x8den\xc3\xad zprost\xc5\x99edkovatele\')\nRun Code Online (Sandbox Code Playgroud)\n这是错误消息:
\n\n有人有同样的问题吗?
\nOpt*_*rks 12
click()尝试在键入之前添加:
cy.get(\'#reasonRecommendationByAgent\')\n .click()\n .type(\'Zd\xc5\xafvodn\xc4\x9bn\xc3\xad doporu\xc4\x8den\xc3\xad zprost\xc5\x99edkovatele\', {force: true})\n .should(\'have.value\', \'Zd\xc5\xafvodn\xc4\x9bn\xc3\xad doporu\xc4\x8den\xc3\xad zprost\xc5\x99edkovatele\')\nRun Code Online (Sandbox Code Playgroud)\n
我们遇到了类似的问题,我可以通过添加点击和聚焦来解决。我想,HELP DOCS文档也推荐了这个。
\n\n\n\nRun Code Online (Sandbox Code Playgroud)\ncy.get('#reasonRecommendationByAgent').click().focused()\n .type('Zd\xc5\xafvodn\xc4\x9bn\xc3\xad doporu\xc4\x8den\xc3\xad zprost\xc5\x99edkovatele', {force: true})\n .should('have.value', 'Zd\xc5\xafvodn\xc4\x9bn\xc3\xad doporu\xc4\x8den\xc3\xad zprost\xc5\x99edkovatele')\n
| 归档时间: |
|
| 查看次数: |
11967 次 |
| 最近记录: |