selenium webdriver - clicking background-image from css -
is there way click on background image defined in css not part of html tag? need click on div tag has @class=hitlocation.
<ul id="uxfoldertree_uxfoldertree_template_treerootelement" class="ui-tree-root"> <li class="-ui-tree-branch -ui-tree-folder -ui-tree-type-root collapsible" data--selectionmode="none" data-level="0" data-path="0" data-rootid="0" data-parentid="0" data-id="0"> <div class="hitlocation">
the css is
.ui-tree .ui-tree-branch.collapsible > .hitlocation { background-image: url("/workarea/frameworkui/images/icons/plus.png"); background-position: 0 center; cursor: pointer;
not directly, no.
you can either:
simply click
hitlocation
element. webdriver implicitly clicks center of element, might enough.use advanced interactions api , specify @ location in element want click.
for example, clicks @ position
[1,1]
counting top-left corner ofhitlocation
element.webelement hitlocation = driver.findelement(by.classname("hitlocation")); new actions(driver) .movetoelement(hitlocation, 1, 1) .click() .perform();
Comments
Post a Comment