Click on a locator using selenium with Java -
i trying automate scenario want click on tree view ('+','-') expand tree element clickable @ ('+','-') icon attached each node.
inspect element able inspect checkbox , label associated each node , not able inspect('+','-').
approach tried :-
getting exact coordinates have click unfortunately unable find coordinates. using sikuli - have done using sikuli, click on ('+','-') icon based upon image of '+' , '-' icon , solution has limitations , not in long run.
the code:
public void expandingmultipletreeicon() throws exception { screen s = new screen(); pattern p = new pattern("c:\\seleniumworkspace\\image.png").similar( (float) 0.7); iterator<match> = s.findall(p); i.next(); i.next().click(); }
the html:
<div id="mps2authoringtree" class="tree-menu mps2authoring ui-menu ui-widget ui-widget-content ui-corner-all" role="menu" tabindex="0"> <ol class="tree" id="test112-v1"> <li class="cmenu toppacktest112-v1 parent item-0 opened" data-rulename="test112" data-memberid="10115" data-memberversion="1" data-membertype="1" data businessregion="foraut" data-istoplevelpackage="true"> <a href="#"> <label for="folder1">test112-v1</label> <input type="checkbox" name="test112" id="checkboxtoppacktest112-v1" class="checkbox-toppack"> </a> <ol style="display: block;"> <li data-rulename="meta data" data-packagepath="test112/meta data" data-rtsprojectname="austria" data-memberid="10115" data-memberversion="1" data-membertype="1" data-businessregion="foraut" data-manual="false" data-memberstatus="draft" data-istoplevelpackage="undefined" data-isrule="false" data-membername="test112" data-isvolumebandingrule="false" data-programmecappingrule="false" class="cmenu metatest112-v1 item-1"> <a href="#"> <label for="subfolder2">meta data</label> <input type="checkbox" name="test112/10115/meta data" id="checkboxmetatest112-v1" class="checkbox-meta"> </a> </li> </ol> </li> </ol> </div>
wiki
Comments
Post a Comment