Using this WaTin feature user would be able to get all the controls types dynamically used in web page.
Let me give an example to explain this with clear picture.
Suppose that developer has placed a table on webpage. This table would contents many controls like textbox, button, picture box, label, dropdown, list etc. etc. all this control would appear in table cells dynamically, it means we are not sure when and at what position of cells it will appear in table.
Now we have to read this control on fly and performed some basic operation.
So being an automation engineer, we have programmed our automation code in such a way to know about this control and where it has appeared then performed operation or read properties of that control.
Its bit tricky to handle this kind of situation.
To solve this kind of issues WaTin have provided one best feature to get the type of controls and then based on control we can call our custom method to either get the properties or performed common action.
Here I will only show to how to read controls types on FLY using WaTin.
Below is the Image of web page (to automate this scenario I have developed one basic web application)
IE ie = IE.AttachTo<IE>(Find.ByUrl(“http://localhost:28348/Home.aspx“));
var tablecells = ie.Table(“table“).TableCells;
var type = new string[tablecells.Count];
int i = 0;
foreach (TableCell tableCell in tablecells)
string watinType = tableCell.Elements.GetType().FullName;
if (watinType != null) type[i] = watinType.Split(‘.’);