I have heard as well as followed concept of keeping UI objects in external filed (xml or properties files in java). But there are times when I need to keep the objects with in test because I use them dynamically.
For example consider one html table with div having uniquq id. The div could have n number of links. I need to read their innertext. So I would be doing -
for(int i=0; i<=CSSCount(div[id='unique']>a);i++) {
print(selenium.getText(css=div[id='unique']>a:nth-child(i)))
}
So I have app object available in test class it self, that is - css=div[id='unique']>li:nth-child(i) as I need to iterate through its elements. Is it possible to externalize such app objects also?