当多个输入具有相同的“名称”时,如何用 WatiN 填充特定的输入字段?
我正在使用 WatiN 和 C# 在线填写表单,但我的搜索字段与另一个元素具有相同的名称。我的搜索字段定义如下:
<input type="text" value="" size="50" name="search">
在同一屏幕的另一个部分中还有一个不同的搜索字段,定义为:
<input class="Search-TextBox" type="text" value="" size="15" name="search">
我想填写前面提到的文本输入搜索字段。有没有办法根据大小查找并填充搜索框?
我对搜索字段的“提交”按钮也有同样的问题。它的名称和大小相同,那么我如何指定单击哪个按钮进行搜索?
I'm using WatiN and C# to fill out a form online but my Search field has the same name as another element. My search field is defined as follows:
<input type="text" value="" size="50" name="search">
There is also a different search field in another section of the same screen defined as:
<input class="Search-TextBox" type="text" value="" size="15" name="search">
I want to fill out the formerly mentioned text input search field. Is there a way to find and fill the search box based on size maybe?
I have the same issue with the search field's Submit button. Its the same name and size so how do I specify which button to click search on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用以下任何一种机制。
如果所有属性都相同,您可以在获得过滤列表后按顺序进行搜索。
You can use any of the following mechanisms
If all the attributes are the same, you can search on the basis of the ordering after getting a filtered list.