element_to_be_clickable(locator)


是等待頁面元素可見的時候操作,會設置一定范圍的時間,如果在時間范圍內,元素可見,就

執行操作,元素不可見,就會引發TimeoutException的異常。如下是element_to_be_clickable

類的源碼

from selenium.webdriver.common.by import By
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
driver = webdriver.Firefox()
driver.implicitly_wait(30)
driver.get('http://www.baidu.com')
so = WebDriverWait(driver,10).until(expected_conditions.element_to_be_clickable((By.ID,'kwkw')))
so.send_keys('appium')
driver.quit()

 
         
         
       


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM