3
셀렌 서버 (v.2.0b2)를 실행하고 Python 스크립트를 작성하여 웹 애플리케이션에 테스트 스위트를 실행합니다.Selenium-rc의 확인 창 받기
from selenium import webdriver
import selenium
selenium = selenium.selenium('127.0.0.1', 3333, '*firefox', 'http://localhost/')
selenium.start()
profile = webdriver.FirefoxProfile('selenium')
browser = webdriver.Firefox(profile)
browser.get('http://localhost:8080/index.html?no_auto_login=1')
확인 대화 상자가 표시되는 로그인 버튼이 있지만 서버가 튀어 나오기 전에 서버와 왕복을 왕복합니다.
submit_button = browser.find_element_by_css_selector('#btnSubmit')
submit_button.click()
alert = browser.switch_to_alert()
assert alert.text == 'Server Login Error...'
alert.accept()
호출 후 selenium.is_confirmation_present을 submit_button.click 후 항목을() 주석과() 나는 확인 상자 볼 수 기다릴 수있는 방법
거짓 반환? selenium.is_confirmation_present()가 true를 반환하지 않는 이유는 무엇입니까?