tags:

views:

64

answers:

3

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?

+2  A: 

Try this:

ie.Button(Find.ByName(new Regex(input)) && Find.ByIndex(1 /* or 2 */)).Click();
prostynick
A: 

Try this:

    ButtonCollection buttonCol = ie.Buttons;
    buttonCol = buttonCol.Filter(Find.ByName(new Regex(input)));
    buttonCol[1].Click();
    buttonCol[2].Click();
alonp