0
關於this問題,我想送username
/password
使用IE
提醒輸入欄,但密碼字段總是空阱所有文字去用戶名字段如何模擬TAB鍵與IE驅動程序服務器按
代碼輸出:
from selenium.webdriver.common.keys import Keys
username = "some_user"
password = "some_pass"
driver.switch_to.alert.send_keys(username + Keys.TAB + password)
# text in username field: "some_user.some_pass"
driver.switch_to.alert.send_keys(username + '\t' + password)
# text in username field: "some_user some_pass"
driver.switch_to.alert.send_keys(username + u'u\0009' + password)
# text in username field: "some_user some_pass"
那麼如何把光標移到「密碼」欄發送鍵後,「用戶名」欄
我認爲這是錯誤的IE驅動程序,因爲它的它不工作 – thebadguy