硒处理自动完成? [英] Can selenium handle autocomplete?

查看:144
本文介绍了硒处理自动完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个测试用例需要输入一个基于ajax的文本字段的部分值,并验证列表是否具有预期的内容。如果是,请选择内容。任何想法如何使这项工作?

I have a test case that requires typing in a partial value into an ajax based textfield and verifying the list has the expected content. If it does, select the content. Any idea how to make this work?

推荐答案

类型命令可能不足以触发自动完成。戴维·韦伯的建议,否则现货。我唯一的补充将是你可能需要 typeKeys 命令,这会导致略微不同的JavaScript事件被触发,这可能更有可能触发自动完成小部件。

The type command may not be enough to trigger the autocomplete. Dave Webb's suggestions are otherwise spot on. My only addition would be that you might need the typeKeys command, which causes slightly different JavaScript events to be fired, which may be more likely to trigger the autocomplete widget.

这篇关于硒处理自动完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆