selenium - How to resolve this click conflict? -


<div id="maintag" class='maintag'>     <div id="submaintag1" class="submaintag1">         <div id="subtag1" class="subtag1">                    <detail explanation below>         <div id="subtag1" class="subtag1">                     <same above, difference text message >          <div id="subtag1" class="subtag1">                     <same above, difference text message>  

detailed snippet of subtag1

<div id="maintag" class='maintag'>          <div id="submaintag1" class="submaintag1">              <div id="subtag1" class="subtag1">                  <div id="subtag2" class="subtag2">                      <div id="subtag2a" class="subtag2a"></div>                      <div id="datapreview" class="datapreview">      <!-- these below lines not enabled/expanded -->                          <div id="datanote" class="datanote">                             <div id="titlebar" class="titlebar">                                 <span id="datatime" class="dattime">9/10/2017 7:01 pm</span>                                 <div id="deletebutton" class="deletebutton">                                     <img class="someimg" src="someimg"> </div> </div>                             <div id="contentdiv" class="contentdiv">                                 <div id="datatitle" class="datatitle">some data1</div>                                 <div id="datacontent" class="datacontent">some data1 body text </div> </div> </div> </div>     <!-- lines disabled till here--> </div> </div> 

on clicking on subtag1, disabled line gets enabled/expanded.

unable click on div element.

//div[@id="maintag"]/div[@id='submaintag1']/div[1] //div[@id="maintag"]/div[@id='submaintag1']/div[2] //div[@id="maintag"]/div[@id='submaintag1']/div[3] 

when click on of above elements, says webdriverexception:

message: unknown error: element //div[@id="maintag"]/div[@id='submaintag1'/div[2] not clickable @ point (433, 239). other element receive click: //div[@id="maintag"]/div[@id='submaintag1'/div[2] (session info: chrome=60.0.3112.113) (driver info: chromedriver=2.31.488774 (7e15618d1bf16df8bf0ecf2914ed1964a387ba0b),platform=mac os x 10.11.6 x86_64)

looking @ given code structure there no second or third sibling, children. you'll need adjust xpath right node.

for example, locate second 'div' anywhere within 'submaintag1':

xpath=(//div[@id="maintag"]/div[@id='submaintag1']//div)[2] 

if forgot closing div's in code example, adding brackets should enough:

xpath=(//div[@id="maintag"]/div[@id='submaintag1']/div)[2] 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -