Login in a Webpage with Watin
问题 I try to login on a webpage. On the webpage are two forms with inputs, the inputs have the same Id("username"). How can i get the right inputs to set my text? This is my wrong Code: browser.TextField(Find.ByName("username")).TypeText("test123"); or browser.Form(Find.ByName("form_login")).TextField(Find.ByName("username")).TypeText("test123"); 回答1: You can collect all text field in the page and then perform the action on the first or second appearance of the desired id. For example: