Selenium IDE:我无法使用 selenium IDE 记录从 Web 应用程序的下拉列表中选择的值
这就是我想要做的:
- 打开我的网络应用程序
- 转到详细信息页面以创建新实体
- 在创建实体时,我需要从下拉列表中选择一些值 下来并将其记录在 Selenium IDE 上
- 完成上述所有步骤后,它们已记录到 Selenium IDE 中
- 当我播放时,每当它尝试执行操作时都会抛出错误 运行脚本,其中一些 需要从下拉列表中进行选择。
已经被这个问题困扰了一段时间了。尝试使用“焦点”,但效果不佳。任何人都可以在这方面提供帮助吗?
This is what I am trying to do:
- Open my web application
- Go to the details page to create a new entity
- While creating entity, I need to select some values form the drop
down and record it on Selenium IDE - Did all the above steps, they were recorded into Selenium IDE
- When I play back, it is trowing an error whenever it is trying to
run the script, where some
selections from dropdown is needed.
Have been stuck with this for quite sometime now. Tried using "focus", but it did not work as well. Can anyone help in this regards?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
获取 Firebug
检查元素以找出该 UI 元素的类 ID。
您获得该值的代码使用标签时状态值将如下所示。
option value="HI">夏威夷
应该可以了。
Get Firebug
Inspect the element to find out the class ID of that UI Element.
The code where you get that state value would look like this where you use the label.
option value="HI">Hawaii</option
That should do it.
由于我不了解您的网络应用程序,我将提出一些建议。
记录和重播并不总是捕获它需要回复的所有项目。不幸的是,这是一个用词不当。
尝试执行
select |定位器 | itemInSelect
可能值得添加一个 waitForX,其中 X 是您正在等待的项目,在此之前调用,以防测试到达该点时未加载 select。
Since I don't know your web application I am going to make a number of suggestions.
Record and replay will not always capture all of the items that it needs to reply. This is a misnomer unfortunately.
Try doing
select | locator | itemInSelect
It might be worth adding a waitForX, where X is the item you are waiting for it, call before that in case that select is not loaded when the test hits that point.
我在邮政编码框中输入邮政编码,然后从出现的下拉列表中选择商店,也遇到了类似的问题。
记录的动作并不完全准确。
我最终通过使用 sendKeys (与您无关)修复它,暂停并单击(获取选择的 xpath)
I had a similar issue with post code boxes into which you enter a postcode, and then select a Store from the dropdown that appears.
The actions recorded were not completely accurate.
I ended up fixing it by using sendKeys (not relevant to you), pause and click (got the xpath of the selection)