您如何在下拉列表中选择一个元素,如果使用它的ID不起作用?
我正在使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论