python - element is not clicked [selenium] -
i using selenium2library(python) our automation. method used
def get_appointment_from_manage(self, date, appt_id): ref_date = "//*[@data-date=\"%s\"]" % date time.sleep(2) logging.info(date) logging.info(appt_id) while not self.is_element_present_by_xpath(ref_date) : self._current_browser().find_element_by_xpath("//*[@id=\"calendar1\"]/div[1]/div[3]/div/button[2]").click(); time.sleep(2) element = self._current_browser().find_element_by_xpath("//*[@data-aid=\"%s\"]" % appt_id) logging.info(element) actionchains(self._current_browser()).move_to_element(element).click().perform()
the logging states element found doesn't click. part isn't clicking.
element = self._current_browser().find_element_by_xpath("//*[@data-aid=\"%s\"]" % appt_id) logging.info(element) actionchains(self._current_browser()).move_to_element(element).click().perform()
when inspect element, whole element covered in blue. don't know missing. firefox version 28. in advance!
edit
this html
<div class="fc-event-container"> <div class="fc-event-box" style="position:relative;z-index:1"></div> <div data-aid="31" class="fc-event-data-container fc-status-2" style="position:absolute;top:0px;right:0;bottom:-62px;left:0;z-index:1"> <div class="fc-event-data-box"> <a class="fc-time-grid-event fc-event fc-start fc-end evnt-1419408000000" style="top: 0px; bottom: -62px; z-index: 1; left: 0%; right: 0%;"> <div class="fc-content"> <div class="fc-time" data-start="8:00" data-full="8:00 - 8:30 am" style="display:none;"> <span>8:00 - 8:30</span> </div> <div class="fc-title">robot-fn</div> <span class="fc-product">home loans</span> </div> <div class="fc-bg"></div> </a> </div> </div> </div>
i'm not sure trying, if want click on <a>
tag (which clickable), then, need hold element, not <div>
contains it.
try somthing this: (i didn't try xpath take general idea)
element = self._current_browser().find_element_by_xpath("//*[@data-aid=\"%s\"]//a" % appt_id)
Comments
Post a Comment