robotframework - 如何使用机器人框架单击表单中的元素
问题描述
我尝试单击表单中的元素,但机器人不喜欢我提供的元素。我尝试了 3 种方法,但仍然找不到定位器
Wait Until Element Is Visible &{FinishCall}[endCall] timeout=60s
Click Element &{FinishCall}[endCall]
Submit Form &{FinishCall}[endCall]
Execute Javascript document.getElementById("j_id0:currentCallLogForm:currentCallLogPB:j_id7:j_id9").addEventListener('click', function (){console.log('execute on click')});
元素位于 iframe 下的示例 HTML
<input class="btn" id="j_id0:currentCallLogForm:currentCallLogPB:j_id7:j_id9" name="j_id0:currentCallLogForm:currentCallLogPB:j_id7:j_id9" onclick=";A4J.AJAX.Submit('j_id0:currentCallLogForm',event,{'similarityGroupingId':'j_id0:currentCallLogForm:currentCallLogPB:j_id7:j_id9','oncomplete':function(request,event,data){goToCustPage();},'parameters':{'j_id0:currentCallLogForm:currentCallLogPB:j_id7:j_id9':'j_id0:currentCallLogForm:currentCallLogPB:j_id7:j_id9'} ,'status':'sfStatus'} );return false;" value="Finish Not On Call" type="button">
任何人请帮助我。
解决方案
您操作的元素很可能在 iframe 内,检查页面上的 iframe 并首先选择它 - 使用以下关键字
Select Frame name or id of iframe
Click Element element locator or name or id
推荐阅读
- firebase - 添加firebase包后我无法运行我的应用程序我仍然遇到错误
- memory - 为什么从 Realm DB 加载图像时 SwiftUI List 会崩溃?RAM 达到极限
- sql-server - 从包含 XML 数据的特定列创建表
- vlc - VLC:如何使用背景图像更改视频的某个关键颜色?
- python - 图像处理/OCR 技术分离触摸字符
- ios - Swift 组合:PassthroughSubject UnsafeMutablePointer
- r - 如何找到前 10 个常用词?
- c++ - 如何强制 llvm cmake 仅使用给定的库路径?
- python - Kivy Line(circle=(x, y, r)) - 半径动画
- python - 如何在 python matplot 中创建此图