我正在做一個專案。在這個專案中,我從主門戶創建了一個帳戶。并為其設定密碼。當用戶第一次登錄門戶時,他們會看到一個關于條款和條件的對話框。我只想檢查一次復選框。
這是我的登錄方法:
@pytest.fixture()
def PracticeLogin(setup):
driver = setup
driver.get(loginSheet.cell(3, 2).value)
driver.implicitly_wait(5)
login = LoginScreen(driver)
login.SetUsername(loginSheet.cell(3, 3).value)
login.SetPassword(loginSheet.cell(3, 4).value)
login.SignIn()
if "Terms & Policies" in driver.page_source:
driver.find_element(By.XPATH, '//div[@]//*[@]').click()
driver.find_element(By.XPATH, Locators.continueButton).click()
driver.implicitly_wait(10)
我正進入(狀態 NoSuchElementException
這是門戶網址
Email: [email protected]
Pass: Test@2020
uj5u.com熱心網友回復:
請試試這個:
@pytest.fixture()
def PracticeLogin(setup):
driver = setup
driver.get(loginSheet.cell(3, 2).value)
driver.implicitly_wait(5)
login = LoginScreen(driver)
login.SetUsername(loginSheet.cell(3, 3).value)
login.SetPassword(loginSheet.cell(3, 4).value)
login.SignIn()
checkboxes = driver.find_elements(By.XPATH, '//div[@]//*[@]')
if checkboxes:
checkboxes[0].click()
driver.find_element(By.XPATH, Locators.continueButton).click()
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/405006.html
標籤:
上一篇:與補充影像的背景隔離
