判断传入元素是否可见

# 判断传入的元素是否可见 visibility_of_element_located()
from selenium import webdriver
import time
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.wait import WebDriverWait
from  selenium.webdriver.common.by import By
driver = webdriver.Chrome()
driver.get("http://ibsaas-test-wps.rongdasoft.com/#/login")
time.sleep(3)
print(ec.title_contains('智慧'))

#找元素
element =driver.find_element_by_class_name('el-input__inner阿松大 ')
locator = (By.CLASS_NAME,'el-input__inner')
#一直找元素,直到找到为止
WebDriverWait(driver,100).until(ec.visibility_of_element_located(locator))

  

posted on 2021-10-12 20:32  爱前端的小魏  阅读(20)  评论(0编辑  收藏  举报

导航