def click_link_text(self, link_text, timeout=settings.SMALL_TIMEOUT):
<EOL>if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:<EOL><INDENT>timeout = self.__get_new_timeout(timeout)<EOL><DEDENT>if self.browser == '<STR_LIT>':<EOL><INDENT>if self.is_link_text_visible(link_text):<EOL><INDENT>element = self.wait_for_link_text_visible(<EOL>link_text, timeout=timeout)<EOL>element.click()<EOL>return<EOL><DEDENT>self.open(self.__get_href_from_link_text(link_text))<EOL>return<EOL><DEDENT>if not self.is_link_text_present(link_text):<EOL><INDENT>self.wait_for_link_text_present(link_text, timeout=timeout)<EOL><DEDENT>pre_action_url = self.get_current_url()<EOL>try:<EOL><INDENT>element = self.wait_for_link_text_visible(<EOL>link_text, timeout=<NUM_LIT>)<EOL>self.__demo_mode_highlight_if_active(link_text, by=By.LINK_TEXT)<EOL>try:<EOL><INDENT>element.click()<EOL><DEDENT>except (StaleElementReferenceException, ENI_Exception):<EOL><INDENT>self.wait_for_ready_state_complete()<EOL>time.sleep(<NUM_LIT>)<EOL>element = self.wait_for_link_text_visible(<EOL>link_text, timeout=timeout)<EOL>element.click()<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>found_css = False<EOL>text_id = self.get_link_attribute(link_text, "<STR_LIT:id>", False)<EOL>if text_id:<EOL><INDENT>link_css = '<STR_LIT>' % link_text<EOL>found_css = True<EOL><DEDENT>if not found_css:<EOL><INDENT>href = self.__get_href_from_link_text(link_text, False)<EOL>if href:<EOL><INDENT>if href.startswith('<STR_LIT:/>') or page_utils.is_valid_url(href):<EOL><INDENT>link_css = '<STR_LIT>' % href<EOL>found_css = True<EOL><DEDENT><DEDENT><DEDENT>if not found_css:<EOL><INDENT>ngclick = self.get_link_attribute(link_text, "<STR_LIT>", False)<EOL>if ngclick:<EOL><INDENT>link_css = '<STR_LIT>' % ngclick<EOL>found_css = True<EOL><DEDENT><DEDENT>if not found_css:<EOL><INDENT>onclick = self.get_link_attribute(link_text, "<STR_LIT>", False)<EOL>if onclick:<EOL><INDENT>link_css = '<STR_LIT>' % onclick<EOL>found_css = True<EOL><DEDENT><DEDENT>success = False<EOL>if found_css:<EOL><INDENT>if self.is_element_visible(link_css):<EOL><INDENT>self.click(link_css)<EOL>success = True<EOL><DEDENT>else:<EOL><INDENT>success = self.__click_dropdown_link_text(<EOL>link_text, link_css)<EOL><DEDENT><DEDENT>if not success:<EOL><INDENT>element = self.wait_for_link_text_visible(<EOL>link_text, timeout=settings.MINI_TIMEOUT)<EOL>element.click()<EOL><DEDENT><DEDENT>if settings.WAIT_FOR_RSC_ON_CLICKS:<EOL><INDENT>self.wait_for_ready_state_complete()<EOL><DEDENT>if self.demo_mode:<EOL><INDENT>if self.driver.current_url != pre_action_url:<EOL><INDENT>self.__demo_mode_pause_if_active()<EOL><DEDENT>else:<EOL><INDENT>self.__demo_mode_pause_if_active(tiny=True)<EOL><DEDENT><DEDENT>
This method clicks link text on a page