【发布时间】:2020-10-24 16:30:44
【问题描述】:
在网站中:https://www.testandquiz.com/selenium/testing.html 有一个下拉菜单位于此处 enter image description here
html如下:
<select id="testingDropdown">
<option id="automation" value="Automation">Automation Testing</option>
<option id="performance" value="Performance">Performance Testing</option>
<option id="manual" value="Manual">Manual Testing</option>
<option id="database" value="Database">Database Testing</option>
</select>
我想:
- 点击提到的下拉菜单
- 统计项目数
- 从列表中选择随机项
如何处理使用柏树的问题?
我尝试了以下但测试失败
describe('Cypress.io tests', function() {
it('Open cypress.io page', function() {
var cypressPage = 'https://www.testandquiz.com/selenium/testing.html'
cy.visit(cypressPage)
cy.xpath("//[@id='testingDropdown']").click();
})
})
【问题讨论】:
-
究竟是什么以错误结束?似乎是什么问题?在您的代码中,我没有看到尝试选择随机值。
标签: javascript drop-down-menu cypress