在触发下一个点击事件之前,我尝试使用 selenium webdriver 等待购物车页面上的计算总计。但我有一个例外。我可以等待的页面上没有其他元素。我认为为有经验的开发人员找到解决方案真的很容易,但我不是那个人。
我使用这个等待命令:
wait.until(ExpectedConditions.textToBePresentInElementLocated(By.cssSelector(".grand.totals .price"), "35,75 €"));`
这是我尝试选择元素的源代码片段。
<tr class="grand totals">
<th class="mark" scope="row">
<strong data-bind="i18n: title">Bestellsumme</strong>
</th>
<td data-bind="attr: {'data-th': title}" class="amount" data-th="Bestellsumme">
<strong><span class="price" data-bind="text: getValue()">35,75 €</span></strong>
</td>
</tr>
这是我得到的例外。
org.openqa.selenium.ElementNotVisibleException:元素不可交互(会话信息:chrome=75.0.3770.100)(驱动程序信息:chromedriver=74.0.3729.6(255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729),@=平台NT 10.0.17134 x86_64)(警告:服务器未提供任何堆栈跟踪信息)命令持续时间或超时:0 毫秒构建信息:版本:'3.141.59',修订:'e82be7d358',时间:'2018-11-14T08 :17:03' 系统信息:主机:'MARCEL-THINK',ip:'10.110.12.3',os.name:'Windows 10',os.arch:'amd64',os.version:'10.0',java .version: '11.0.3' 驱动程序信息:org.openqa.selenium.chrome.ChromeDriver
料青山看我应如是
相关分类