我正在尝试让Selenium IDE检查一些文本,并确保它只是数字,我已经创建了以下内容(使用Google),但似乎每次都失败。
错误: css=tbody上的assertText >tr:nth-css=tbody(1)> td:nth-child(1),值为regexpi:^0-9+$ Failed: 09:44:54实际值"10640355“与"regexpi:^0-9+$”不匹配
有没有人能告诉我我需要更改什么,或者有一个关于如何正确添加此检查的逐步指南
发布于 2021-01-14 18:40:31
https://www.selenium.dev/selenium-ide/docs/en/api/commands#assert-text
断言文本不支持正则表达式:
https://github.com/SeleniumHQ/selenium-ide/issues/141获取详细信息。
解决方法:
屏幕截图

代码:
store text | css=tbody > tr:nth-child(1) > td:nth-child(1) | actualText
execute script | return RegExp('^[0-9]+$','g').test(${actualText}) | isNumber
assert | isNumber | truehttps://stackoverflow.com/questions/65716689
复制相似问题