algorithm - How to generate comprehensive Selenium variable name for complex HTML elements -


i trying develop own selenium page object generator. have encountered problem have generate meaningful names web elements.

i know can "normal" elements: grab html element, id or class , use extracted id make normal variable name. example:

<input type="text" name="username" size="10"> 

here can extract "name" attribute , generate variable name username.

but let's there more complex html elements (link example). example: open google , type: selenium features , limitations. when inspect first link, looks horrible , complex:

<a href="/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;uact=8&amp;ved=0ahukewizi6z3i6pwahwnkjokhvuvbm8qfggkmaa&amp;url=http%3a%2f%2fwww.testinginterviewquestion.com%2f2014%2f04%2fwhat-are-advantages-and-disadvantages_17.html&amp;usg=afqjcnefzcvjn3i-ijijif8wqych86k-_a" onmousedown="return rwt(this,'','','','1','afqjcnefzcvjn3i-ijijif8wqych86k-_a','','0ahukewizi6z3i6pwahwnkjokhvuvbm8qfggkmaa','','',event)" data-href="http://www.testinginterviewquestion.com/2014/04/what-are-advantages-and-disadvantages_17.html">what advantages , disadvantages of selenium ? - software ...</a> 

exactly how supposed generate comprehensive page object variable name that? there sort of algorithm?


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -