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

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

问题描述

我有一个测试用例,需要在基于 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?

推荐答案

type 命令可能不足以触发自动完成.Dave Webb 的建议是正确的.我唯一的补充是您可能需要 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天全站免登陆