I am using Watin to test this page but I am unable to get to the subpage of each row in the table.
http://www.domea.dk/sog-bolig/Ledige-boliger/Sider/default.aspx
Any idea how to loop through each row and click the link to the subpage.
I am able to get a hold of the table that holds each row using:
Table table_name = browser.Table(Find.ById("listTable"));
And then loop through each row using: foreach (TableRow currRow in table_name.TableRows) { var s = currRow.TableCell(Find.ByIndex(0)); }
But I don't know how to get the "onclick" event inside of the cell to be "clicked" using watin.
If you want to click on each row link this is the code you need to use:
You were going good but needed to get to the link on each row before you can click on it. In sample code I'm using the first link found on the cell
c.Links[0].Click();
if this is going to be used as a production code you need to check that the first link is the one you need, for example, checking that the URL of the link is going to xxxx or it contains a specific web page (.Contains
) etc.