Last active
June 26, 2018 09:48
-
-
Save rinchik/85b5a22b9a342e09edfc6f330f1e072d to your computer and use it in GitHub Desktop.
Double-click + click in Python Selenium for rich tables editing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.common.action_chains import ActionChains | |
def enter_hours(self, cell, amount): | |
#Double-click | |
actions = ActionChains(self.driver) | |
actions.move_to_element(cell) | |
actions.double_click(cell) | |
actions.perform() | |
#Click | |
cell.click() | |
#Now, when floating input is visible, grab it and use it! | |
control = self.driver.find_element_by_css_selector('.grid-editbox') | |
control.send_keys(amount) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment