在 watin 中使用正则表达式
我在 watin 中使用正则表达式。
我有类似的东西: ie.Button(Find.ByName(new Regex(input))).Click();
但我不想单击第二个或第三个匹配的按钮,而不是第一个按钮。
我该怎么做?
I'm using regular expression in watin.
I have something like: ie.Button(Find.ByName(new Regex(input))).Click();
but I wan't to click on the second or third button that match and not the first one.
How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
试试这个:
Try this:
试试这个:
Try this:
很多时候我发现需要选择比第一次返回的更高的值是因为 find.by*() 构造上的限定符太少了。您可以尝试为这样的情况编写自己的代码,这对您的特定情况更有意义。
linq 查询示例:
类似这样的内容将允许您仅选择您想要的内容。它还为您提供了一种通过 .ToList() @ 末尾快速检查计数的方法。或者使用下面的 foreach 循环来完成所需的操作。
a lot of times I find the need to select a higher than first returned is because there are too few qualifiers on the find.by*() construct. you might try writing your own for cases like this that make more sense for your particular case.
example linq query:
Something like this will allow you to select only what you want. It also gives you a way to check count quickly with a .ToList() @ the end of it. or use a foreach loop following to complete the actions needed.