def js_click(self, selector, by=By.CSS_SELECTOR):
selector, by = self.__recalculate_selector(selector, by)<EOL>if by == By.LINK_TEXT:<EOL><INDENT>message = (<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>logging.debug(message)<EOL>self.click(selector, by=by)<EOL>return<EOL><DEDENT>element = self.wait_for_element_present(<EOL>selector, by=by, timeout=settings.SMALL_TIMEOUT)<EOL>if self.is_element_visible(selector, by=by):<EOL><INDENT>self.__demo_mode_highlight_if_active(selector, by)<EOL>if not self.demo_mode:<EOL><INDENT>self.__scroll_to_element(element)<EOL><DEDENT><DEDENT>css_selector = self.convert_to_css_selector(selector, by=by)<EOL>css_selector = re.escape(css_selector)<EOL>css_selector = self.__escape_quotes_if_needed(css_selector)<EOL>self.__js_click(selector, by=by)  <EOL>self.__demo_mode_pause_if_active()<EOL>
Clicks an element using pure JS. Does not use jQuery.