java - 我如何使用硒等待 magento 购物车页面上的预期值
问题描述
在触发下一个点击事件之前,我尝试使用 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@{#29}),平台=Windows 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
解决方案
推荐阅读
- reactjs - 从右到左(使用 React.js)支持网站/门户网站的真正问题是什么?
- gis - PostGIS:在半径内查找重复标签
- mysql - 如何以某种方式显示查询?
- android - 如何创建显示密码的自动填充提示?
- blazor - Blazor,关于编辑表单中模型更改的事件
- php - 在多维数组中查找重复项并回显它们
- python - 转换为 exe 文件 tkinter 后出现 cx_freeze 错误
- mysql - 从数据库 Mysql/MariaDB 中获取正确的数据集
- python - 套接字 OSError:[WinError 10022]
- python - 如何用 Python 中的变量替换部分函数调用?