【发布时间】:2019-08-13 21:33:07
【问题描述】:
我正在尝试单击一个按钮,然后从下拉列表中选择一个值。我点击城市按钮,然后选择多伦多。但是我什至无法点击按钮。
这里是html:
我尝试过使用 by.className : element(by.className("filter-button")).click();
使用者。路径: element(by.xpath("/html/body/div[2]/div/div/div/div[1]/div[1]/div[1]")).click();
好像没用。
<div class="content-wrapper list-page">
<div class="content">
<div class="section-wrapper page-full-width">
<div class="section page-centered">
<div class="filter-bar"><span class="medium-utility-label filter-by-label">Filter by:</span>
<div role="button" class="filter-button-wrapper" tabindex="0" aria-label="Filter by City: All" aria-haspopup="true" aria-expanded="false">
<div class="filter-button">City
<svg class="filter-button-caret icon icon-caret-down" width="16px" height="16px" viewBox="0 0 16 16">
<path d="M7.6741598,11.3413318 L8.03952616,11.7324251 L8.40489252,11.3413318 L14.8653664,4.42595055 L14.1346336,3.74328687 L7.6741598,10.6586682 L8.40489252,10.6586682 L1.86536636,3.65866816 L1.13463364,4.34133184 L7.6741598,11.3413318 Z M7.6741598,11.3413318" fill="#979797"></path>
</svg>
</div>
<div class="filter-popup">
<ul>
<li>
<a class="category-link selected" href="?" rel="nofollow">
<svg class="selected-filter-checkmark icon icon-checkmark" width="16px" height="16px" viewBox="0 0 16 16">
<path d="M6.2,14.4L0,8.2l2.5-2.5l3.5,3.5c0.1,0.1,0.2,0.1,0.2,0L13.5,2L16,4.5L6.2,14.4z"></path>
</svg>All</a>
</li>
<li><a class="category-link" href="?location=Chicago%2C%20Illinois" rel="nofollow">Chicago, Illinois</a>
</li>
<li><a class="category-link" href="?location=Edmonton%2C%20Alberta%2C%20Canada" rel="nofollow">Edmonton, Alberta, Canada</a>
</li>
【问题讨论】:
标签: javascript html protractor