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&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahukewizi6z3i6pwahwnkjokhvuvbm8qfggkmaa&url=http%3a%2f%2fwww.testinginterviewquestion.com%2f2014%2f04%2fwhat-are-advantages-and-disadvantages_17.html&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
Post a Comment