1
我在執行硒代碼時出現錯誤。錯誤:類型對象'Keys'沒有屬性'和絃'
代碼:
driver.find_element_by_id(PlaylistManagerLocators.Folder_Name).send_keys(Keys.chord(Keys.CONTROL, "a"), "Auto_Folder5763")
錯誤:
AttributeError: type object 'Keys' has no attribute 'chord'
我已經導入的所有必需的文件。
from selenium.webdriver.common.keys import Keys
from selenium.webdriver import ActionChains
driver.find_element_by_id(PlaylistManagerLocators.Folder_Name).send_keys(Keys.chord(Keys.CONTROL, "a"), "Auto_Folder5763")
是它爲我工作用下面的代碼:driver.find_element_by_id(PlaylistManagerLocators.Folder_Name).send_keys(Keys.CONTROL, 'A') driver.find_element_by_id(PlaylistManagerLocators.Folder_Name).send_keys(Keys.DELETE) 驅動程序。 find_element_by_id(PlaylistManagerLocators.Folder_Name).send_keys(「Auto_Folder5764」) driver.find_element_by_id(PlaylistManagerLocators.Folder_Name).send_keys(Keys.ENTER) –