javascript - Finding and clicking an check box that is part of the jstree using xpath? -


i trying click checkbox part of jstree , every thing have tried far has been unsuccessful. please assist. the goal check checkbox id 733

here html code:

<div id="jstree-1" class="jstree jstree-2 jstree-default jstree-default-responsive jstree-checkbox-no-clicked" role="tree" aria-activedescendant="8528"> <ul class="jstree-container-ul jstree-no-dots jstree-no-icons">     <li id="733" class="jstree-node jstree-open jstree-last" role="treeitem" aria-selected="false" aria-expanded="true">         <i class="jstree-icon jstree-ocl"/>         <a class="jstree-anchor" href="#">             <i class="jstree-icon jstree-checkbox"/>             <i class="jstree-icon jstree-themeicon false jstree-themeicon-custom"/>             accepts cash         </a>         <ul class="jstree-children" role="group" style="">     </li> </ul> 

i trying click on checkbox, present in jstree using selenium webdriver java.

here things have tried far without success.

solution 1:

driver.findelement(by.xpath(".//li[@id = '733']/a/i[@class = 'jstree-icon jstree-checkbox']")).click(); 

solution 2:

driver.findelement(by.id("733")).sendkeys(keys.space); 

solution 3:

webelement element = driver.findelement(by.xpath(".//*[@id='733']/a/i[1]")); actions actions = new actions(driver); actions.movetoelement(element).click().perform(); 

solution 4:

driver.findelement(by.xpath(".//*[@id='733']/a/i[1]")).click(); 

all commands followed following line

driver.manage().timeouts().implicitlywait(10, timeunit.seconds); 

and keep on getting below error code:

unknown error: element not clickable @ point (695, 507). other element receive click: <a class="jstree-anchor" href="#">...</a> 

this happens after executing given solutions:

dropdown box opens not getting clicked

after checkbox clicked in frontend

the following line of code added html:

<span class="selectedcount" data-count="4"> (4)</span> 

i think problem trying click on <i>, while <a> clickable. try this:

driver.findelement(by.xpath(".//li[@id='733']/a")).click(); 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo