您如何在下拉列表中选择一个元素,如果使用它的ID不起作用?

发布于 2025-01-20 03:54:15 字数 1404 浏览 1 评论 0原文

我正在使用Katalon录音机(Chrome Extension)来自动化页面“ Stuvia.com/upload”页面上的表单填充操作,但我无法单击下拉元素。

这是执行日志。

[info] Playing test case Untitled Test Suite / Stuvia upload
[info] Time: Sat Apr 09 2022 01:05:04 GMT-0700 (Pacific Daylight Time) Timestamp: 1649491504473
[info] OS: Windows Version: 10
[info] Browser: Chrome Version: 100.0
[info] If the test cannot start, please refresh the active browser tab
[info] Executing: | open | https://www.stuvia.com/en-us/upload | |
[info] Wait for the new page to be fully loaded
[info] Executing: | click | id=aggreement-basisgegevens | |
[info] Wait for the new page to be fully loaded
[info] Executing: | click | xpath=//button[@type='submit'] | |
[info] Wait for the new page to be fully loaded

我在这里遇到问题。没有记录容器的元素选择。

[info] Executing: | click | id=select2-type-doc-container |  |

我尝试使用我希望选择的元素的ID手动添加脚本(W598-6),但是文本框再次运行后保持空。

[info] Executing: | click | id=select2-type-doc-container
[info] Wait until the element is found
[info] Cannot find element id=select2-type-doc-container-result-w598-6 after 1000ms switch to id=select2-type-doc-container

[info] Executing: | click | id=select2-type-doc-container | |
[info] Time: Sat Apr 09 2022 01:05:33 GMT-0700 (Pacific Daylight Time) Timestamp: 1649491533850
[info] Test case passed

我认为我错误地使用了ID,但不知道该怎么做。 朝着正确方向的轻推将不胜感激。

I am using Katalon recorder(chrome extension) to automate a form filling operation on the page "stuvia.com/upload" but I can't click on a dropdown element.

Here is the execution log.

[info] Playing test case Untitled Test Suite / Stuvia upload
[info] Time: Sat Apr 09 2022 01:05:04 GMT-0700 (Pacific Daylight Time) Timestamp: 1649491504473
[info] OS: Windows Version: 10
[info] Browser: Chrome Version: 100.0
[info] If the test cannot start, please refresh the active browser tab
[info] Executing: | open | https://www.stuvia.com/en-us/upload | |
[info] Wait for the new page to be fully loaded
[info] Executing: | click | id=aggreement-basisgegevens | |
[info] Wait for the new page to be fully loaded
[info] Executing: | click | xpath=//button[@type='submit'] | |
[info] Wait for the new page to be fully loaded

I encounter the problem here. The container's element selection is not recorded.

[info] Executing: | click | id=select2-type-doc-container |  |

I tried to manually add the script using the id of the element I wished to select (w598-6) but the text box remained empty after running it again.

[info] Executing: | click | id=select2-type-doc-container
[info] Wait until the element is found
[info] Cannot find element id=select2-type-doc-container-result-w598-6 after 1000ms switch to id=select2-type-doc-container

[info] Executing: | click | id=select2-type-doc-container | |
[info] Time: Sat Apr 09 2022 01:05:33 GMT-0700 (Pacific Daylight Time) Timestamp: 1649491533850
[info] Test case passed

I think I incorrectly used the id but have no idea how to do it.
A nudge in the right direction would be highly appreciated.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文