我有这段代码,但运行后我在 WebDriverWait 出现错误:
../../../../../../../venv/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py:80: in click
self._execute(Command.CLICK_ELEMENT)
../../../../../../../venv/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py:633: in _execute
return self._parent.execute(command, params)
../../../../../../../venv/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:321: in execute
self.error_handler.check_response(response)
class Consultations(unittest.TestCase):
def setUp(self):
opt = Options()
opt.add_argument("--disable-infobars")
opt.add_argument("--start-maximized")
opt.add_argument("--kiosk")
opt.add_argument("--disable-extensions")
# Pass the argument 1 to allow and 2 to block
opt.add_experimental_option("prefs", {
"profile.default_content_setting_values.media_stream_camera": 1,
"profile.default_content_setting_values.geolocation": 1,
"profile.default_content_setting_values.notifications": 1
})
self.driver = webdriver.Chrome(chrome_options=opt)
self.base_url = test_qa_url
def test_consultation_CCI_WBA_001(self):
loginPage = LoginPage.Loginpage(self.driver)
consultationPage = ConsultationsPage.Consultationspage(self.driver)
homePage = HomePage.Homepage(self.driver)
self.driver.get("https://test-maville.bciti.info/")
# Login ass admin
loginPage.check_login_page_loaded()
loginPage.enter_username()
loginPage.enter_password()
loginPage.click_login()
time.sleep(5)
# Click on admin tab
homePage.click_admin_tab()
time.sleep(12)
# Click on Consultation
homePage.click_admin_consultations()
time.sleep(30)
# Click on Add consultation button
element = WebDriverWait(self.driver, 10).until(
EC.element_to_be_clickable((By.XPATH, admin_consultations_add_consultations_button)))
element.click()
time.sleep(8)
白衣非少年
相关分类