Simulates pressing the DOWN Arrow on the keyboard. By default, "html" will be used as the CSS Selector target. You can specify how many times in-a-row the action happens.
(self, selector="body", times=1, by="css selector")
| 6803 | time.sleep(0.1) |
| 6804 | |
| 6805 | def press_down_arrow(self, selector="body", times=1, by="css selector"): |
| 6806 | """Simulates pressing the DOWN Arrow on the keyboard. |
| 6807 | By default, "html" will be used as the CSS Selector target. |
| 6808 | You can specify how many times in-a-row the action happens.""" |
| 6809 | self.__check_scope() |
| 6810 | self._check_browser() |
| 6811 | if times < 1: |
| 6812 | return |
| 6813 | element = self.wait_for_element_present(selector) |
| 6814 | self.__demo_mode_highlight_if_active(selector, by) |
| 6815 | if not self.demo_mode and not self.slow_mode: |
| 6816 | self.__scroll_to_element(element, selector, by) |
| 6817 | for i in range(int(times)): |
| 6818 | try: |
| 6819 | element.send_keys(Keys.ARROW_DOWN) |
| 6820 | except Exception: |
| 6821 | self.wait_for_ready_state_complete() |
| 6822 | element = self.wait_for_element_visible(selector) |
| 6823 | element.send_keys(Keys.ARROW_DOWN) |
| 6824 | time.sleep(0.01) |
| 6825 | if self.slow_mode: |
| 6826 | time.sleep(0.1) |
| 6827 | |
| 6828 | def press_left_arrow(self, selector="body", times=1, by="css selector"): |
| 6829 | """Simulates pressing the LEFT Arrow on the keyboard. |
no test coverage detected