机器人框架顽固“元素在5秒内没有出现”错误

发布于 2025-01-16 09:00:46 字数 1226 浏览 2 评论 0原文

我正在编写一个机器人框架脚本来填写表格。简单的脚本,使用一本小字典,其余的都可以工作,但我似乎无法与这个特定的领域进行交互。我已经尝试了近十几种与该元素交互的方法,但没有一种有效。你们能帮我一下吗?这是我的代码。

Documentation       Frevvo Form
Library             Zoomba.GUILibrary
Library             Process
Resource            ../../Pages/resource.robot
Suite Setup         Browser Setup       ${url}  ${browser}

*** Keywords ***

Student Form Data
    [Arguments]      ${Frevvo}
    Run Keyword If  '${Frevvo}[TulaneID]'!='${EMPTY}'  Wait For And Input Text  ${TulaneID}  ${Frevvo}[TulaneID]
    Run Keyword If  '${Frevvo}[Term]'!='${EMPTY}'  Wait For And Input Text  ${Term}  ${Frevvo}[Term]

*** Variables ***

${TulaneID}  //*[contains(name(),'TulaneID')]

[already tried the below - no success]

#//input[@name='TulaneID']
#//input[@id='w11562aab5b4b2']
#//*[@id="w11562aab5b4b2"]
#//*[@name="TulaneID"]
#//*[@id="_5le4NoQ-EeyE6Z5Sq_0wTQ"]


*** Test Cases ***

TC 001 Basic Frevvo
    Set To Dictionary           ${Frevvo}           TulaneID=211003560      Term=2022 Spring
    Login
    Student Form Data           ${Frevvo}

这是页面的 HTML。我需要的元素在突出显示的部分 突出显示的元素

I'm writing up a Robot Framework script to fill out a form. Simple script, using a small dictionary, all the rest of it is working but I can't seem to interact with this certain field. I've tried almost a dozen ways to interact with the element, but none of them are working. Can you guys help me out here? Here's my code.

Documentation       Frevvo Form
Library             Zoomba.GUILibrary
Library             Process
Resource            ../../Pages/resource.robot
Suite Setup         Browser Setup       ${url}  ${browser}

*** Keywords ***

Student Form Data
    [Arguments]      ${Frevvo}
    Run Keyword If  '${Frevvo}[TulaneID]'!='${EMPTY}'  Wait For And Input Text  ${TulaneID}  ${Frevvo}[TulaneID]
    Run Keyword If  '${Frevvo}[Term]'!='${EMPTY}'  Wait For And Input Text  ${Term}  ${Frevvo}[Term]

*** Variables ***

${TulaneID}  //*[contains(name(),'TulaneID')]

[already tried the below - no success]

#//input[@name='TulaneID']
#//input[@id='w11562aab5b4b2']
#//*[@id="w11562aab5b4b2"]
#//*[@name="TulaneID"]
#//*[@id="_5le4NoQ-EeyE6Z5Sq_0wTQ"]


*** Test Cases ***

TC 001 Basic Frevvo
    Set To Dictionary           ${Frevvo}           TulaneID=211003560      Term=2022 Spring
    Login
    Student Form Data           ${Frevvo}

And here is the HTML of the page. The element I need is in the highlighted part
Highlighted Element

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

池予 2025-01-23 09:00:46

尝试以下,

*** Variables ***

${TulaneID}           xpath=//input[@id='w11562aab5b4b2']

Try following,

*** Variables ***

${TulaneID}           xpath=//input[@id='w11562aab5b4b2']
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文