typescript - 双击在量角器类型脚本中不起作用
问题描述
双击不起作用。
html:
<div class="dhx_scale_hour" style="height: 851px; width: 50px;">
<div style="height:72px;line-height:30px;">::before "06:00 pm"/div>
<div style="height:72px;line-height:30px;">::before "06:05 pm"</div>
<div style="height:72px;line-height:30px;">::before "06:10 pm"</div>
<div style="height:72px;line-height:30px;">::before "06:15 pm"</div>
<div style="height:72px;line-height:30px;">::before "06:20 pm"</div>
<div style="height:72px;line-height:30px;">::before "06:25 pm"</div>
<div style="height:72px;line-height:30px;">::before "06:30 pm"</div>
<div style="height:72px;line-height:30px;">::before "06:35 pm"</div>
<div style="height:72px;line-height:30px;">::before "06:40 pm"</div>
<div style="height:72px;line-height:30px;">::before "06:45 pm"</div>
<div style="height:72px;line-height:30px;">::before "06:50 pm"</div>
<div style="height:72px;line-height:30px;">::before "06:55 pm"</div>
</div>
量角器类型脚本:
browser.actions().doubleClick(element(by.xpath('//*[@id="appointmentSchedulerControl"]/div[3]/div[7]/div[19]/div[1]'))).perform();
不会出现任何错误,只是不会双击指定的元素。
解决方案
doubleclick()
并且perform()
都返回了承诺。您必须确保您的代码包含以下方式之一。
- 使用异步/等待。
- 链 thenables。
对于选项 2,请参阅以下内容:
perform().then( function () {
browser.sleep(1000); // or you can write if there is some validation here
})
推荐阅读
- c# - 用字典中的列表填充 dataGridView?
- powershell - Reboot during Domain Controller promotion?
- react-native - How to use MQTT on React Native?
- jquery - addClass 在下次单击之前不会呈现
- angular - Ionic 4 and Angular 7 timeout and catchError cannot be found on a get request
- scala - spark load textfile-based hive table as a dataframe (scala)
- python - Installing TensorFlow binaries supporting AVX, FMA, SSE for Python 3.6 and TF 1.12..0
- dart - How to space columns evenly by the top icon and not by the text underneath the icon in a row
- javascript - 以这种方式使用 shortid.generate() 设置唯一的反应键?
- javascript - vue.js:以反应方式更改表的值