我是Robot框架的新手。我想删除一个表行。按下删除按钮时,会出现一个模态对话框,要求用户进行确认。如果用户按下对话框上的“删除”按钮,则应取消该对话框并从主页面中删除该行。
这是我的剧本:
[Arguments] ${name}
Click Element id=showList
Click Button xpath=//tr[@item_name='${name}']//button[@class='btn btn-sm btn-danger']
Choose Cancel On Next Confirmation
Click Button Delete
Confirm Action
Page Should Not Contain Element xpath=//tr[@item_name='${name}']
但我认为Robot无法检测到对话框,因为该行未被删除,我收到此错误:
ElementNotVisibleException: Message: Element is not currently visible and so may not be interacted with
Stacktrace:
at fxdriver.preconditions.visible (file:///tmp/tmp4QvxMM/webdriver-py-profilecopy/extensions/fxdriver@googlecode.com/components/command-processor.js:9982)
at DelayedCommand.prototype.checkPreconditions_ (file:///tmp/tmp4QvxMM/webdriver-py-profilecopy/extensions/fxdriver@googlecode.com/components/command-processor.js:12626)
at DelayedCommand.prototype.executeInternal_/h (file:///tmp/tmp4QvxMM/webdriver-py-profilecopy/extensions/fxdriver@googlecode.com/components/command-processor.js:12643)
at DelayedCommand.prototype.executeInternal_ (file:///tmp/tmp4QvxMM/webdriver-py-profilecopy/extensions/fxdriver@googlecode.com/components/command-processor.js:12648)
at DelayedCommand.prototype.execute/< (file:///tmp/tmp4QvxMM/webdriver-py-profilecopy/extensions/fxdriver@googlecode.com/components/command-processor.js:12590)
有谁知道如何成功按下模态对话框上的删除按钮来删除行?提前谢谢!