i want use watin to get list of elements in a webpage and change all the values
for example i want find all textboxes with "test" ID and change their values
this is my code. but it only change one element, not all ( in my code i looked for elements via thir name )
IE ie = new IE("http://sample.net/");
ie.TableRow(Find.ByText(t => t.Contains("sample text"))).TextField(Find.ByName("second text")).TypeText("write this string");
ie.WaitForComplete();
in this code i find a text in a table, then i find text box (second text) , then it write "write this string" but it i want to do this for all the similar elements i tried with foreach but failed anyone knows the right code?
I can see that you have targeted to a
TableRowand usedTextFieldwhich would be only a textfiled. You should be targeting parent and try to get all the text fields with your criteria.I have tried with below code and worked for me. If you still unable to figure out the issue, you post the error/html source code.