用硒机器人框架无限期地输入文本

发布于 2025-01-24 09:58:54 字数 3627 浏览 0 评论 0原文

我正在尝试使用以下机器人框架代码(Selenium)将长令牌(字符串)输入文本字段中。这是我输入此令牌字符串的屏幕截图。

在此处输入映像

       1 Element should be enabled  xpath=//input[@placeholder='token']
       2 Click Element  xpath=//input[@placeholder='token']
       3 Input Text  xpath=//input[@placeholder='token']  ${token}

但是出于某种原因,执行被卡在第3行,并最终被定时出局。 (300s)。由于第1行和第2行是成功的,因此能够找到文本框元素。知道我该如何解决这个问题?我正在使用Chromedriver。

样本 ${token}= eyJhbGciOiJSU0ExXzUiLCJjdHkiOiJKV1QiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwidHlwIjoiSldUIiwiemlwIjoiREVGIn0.et_wtlu9zrR_u79RvzcgXTdLsPRpYMXB22kH4M5B2nvg9J9yEE_ga0V2zQcwAPrz4g3vBroTKQ21DHByN4v3J2uX0wrkpmIgwF3xwMxKuJCsVZ4-Pf2jZ3ZiJsoKSaivNcPzDW-3VufquJU6ZPRPNzie0NxaQRW-jB1QlO1BqfRjAhTZNBC89xZmqmQZp_CVCm1S3dKY-6fDehx2CQyLgYyjfpUSlwa5TNdKh1EneHbVKqAYaTrJmBoBfk8x68_WyHqCWSrCRE3AxX5X0f27j4JRiuvDMYLDjMPFQMdXzWPH-VqBsY9GG20nsVw-UIxY98ElD2HBzBjRQwoDKzzPv9flxv1Ph_yljT9QkSjBO6iTD_Gd07nk391Rks_jcwTF8hFzIpQ8ImTx1zcntxPkpNFoClAOctQSdeqzgqbWC1KM4P1rncyhVop7T14FVSglVzU2EM7c2QRIoBclW94GvsGtnSXAXzyToQ8QU_qkXdgNQcSxahLfAKhrY3AaXr3y36GFN72J2d7IzO8jYGviAbbKCbUUv7CSVG3NxCThUvrs_yBcBgLpW943iH1ZJp64C1_AIv8JkP3189x7jJJWKk4nw7GW7jEc9DN5JjyDs3nwArvKQ5dyFnqD0aeRKyp5gJW8pyisLIhx2qGGPeMC8GG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edkKCabNVr7dgsCDMVmT4sP-m4RgtZPBVorx4VSwzEEIvp7-yQtcl3aBkEwuO2STPfIy2fnAbK0h8Z9_GF49jMunx66Q-q1AsNNoZxK-BrdqQY6WWsa0Rf__Ib-we6Ms82g1qrQ.GleGbCAM3mfgjhOzcjnpZA

I am trying to input text which is long token(string) into a Text field using following robot framework code (selenium). Here is screenshot where I am entering this token string.

enter image description here

       1 Element should be enabled  xpath=//input[@placeholder='token']
       2 Click Element  xpath=//input[@placeholder='token']
       3 Input Text  xpath=//input[@placeholder='token']  ${token}

But for some reason, execution gets stuck at line 3 and eventually gets timed out (300s). It is able to find the text box element since line 1 and 2, are successful. Any idea how can I resolve this issue? I am using chromedriver.

Sample
${token}= eyJhbGciOiJSU0ExXzUiLCJjdHkiOiJKV1QiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwidHlwIjoiSldUIiwiemlwIjoiREVGIn0.et_wtlu9zrR_u79RvzcgXTdLsPRpYMXB22kH4M5B2nvg9J9yEE_ga0V2zQcwAPrz4g3vBroTKQ21DHByN4v3J2uX0wrkpmIgwF3xwMxKuJCsVZ4-Pf2jZ3ZiJsoKSaivNcPzDW-3VufquJU6ZPRPNzie0NxaQRW-jB1QlO1BqfRjAhTZNBC89xZmqmQZp_CVCm1S3dKY-6fDehx2CQyLgYyjfpUSlwa5TNdKh1EneHbVKqAYaTrJmBoBfk8x68_WyHqCWSrCRE3AxX5X0f27j4JRiuvDMYLDjMPFQMdXzWPH-VqBsY9GG20nsVw-UIxY98ElD2HBzBjRQwoDKzzPv9flxv1Ph_yljT9QkSjBO6iTD_Gd07nk391Rks_jcwTF8hFzIpQ8ImTx1zcntxPkpNFoClAOctQSdeqzgqbWC1KM4P1rncyhVop7T14FVSglVzU2EM7c2QRIoBclW94GvsGtnSXAXzyToQ8QU_qkXdgNQcSxahLfAKhrY3AaXr3y36GFN72J2d7IzO8jYGviAbbKCbUUv7CSVG3NxCThUvrs_yBcBgLpW943iH1ZJp64C1_AIv8J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-EfAZKcw5oK8-hhQTh7CKgwUPKFvoFHOlM_dRP388VtfxjSFPnMKmschUiJH49Vzkdhsgc6qrCcMQSCLedkKCabNVr7dgsCDMVmT4sP-m4RgtZPBVorx4VSwzEEIvp7-yQtcl3aBkEwuO2STPfIy2fnAbK0h8Z9_GF49jMunx66Q-q1AsNNoZxK-BrdqQY6WWsa0Rf__Ib-we6Ms82g1qrQ.GleGbCAM3mfgjhOzcjnpZA

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

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

发布评论

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

评论(1

陌伤ぢ 2025-01-31 09:58:54

一一尝试这些解决方案:

  1. 删除第2行并直接输入文本。
  2. 在第1行后添加睡眠(例如3秒)。
  3. 单击令牌框后,再次检查框并检查选择器。 (也许在单击后,您应该更改选择器)。
  4. 而不是输入文本,而是将令牌粘贴到框中。

Try these solutions one by one:

  1. Remove line 2 and input text directly.
  2. Add sleep after line 1 (for example 3 seconds).
  3. After clicking on the token box, inspect the box again and check your selector. (maybe after clicking you should change your selector).
  4. Instead of inputting text, paste the token into the box.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文