-
Notifications
You must be signed in to change notification settings - Fork 0
Selenium
GitDeveloperKim edited this page Jun 30, 2022
·
6 revisions
브라우저 열기
브라우져 열기 옵션 넣기
윈도우 사이즈
헤들리스
창 최대화
브라우저 닫기
뒤로가기 / 앞으로가기
탭 이동
탭 닫기
엘레먼트에 관하여
엘레먼트 접근하는 방법
엘레먼트 클릭
텍스트 입력
텍스트 삭제
단축키 입력
Frame 이동
경고창 (alert)
경고창 이동
경고창 수락 / 거절
쿠키 값 얻기
자바스크립트 코드 실행
스크롤 이동
새 탭 열기
스크린샷
뒤로가기 앞으로가기
예외처리 – Exceptions
XHR 데이터 확인
- 크롬 설정에서 크롬 버전 확인 104.xxxxxx
- 해당 버전의 크롬 드라이버 다운
- link
from selenium import webdriver
QTEST_URL = "http://16.3.55.172/portal/loginform"
driver = webdriver.Chrome("./driver/chromedriver.exe")
url = QTEST_URL
driver.get(url)
driver.implicitly_wait(3)
driver.find_element_by_id("userName").send_keys("id 입력")
driver.find_element_by_id("password").send_keys("pwd 입력")
driver.find_element_by_id("loginButton").click()
driver.implicitly_wait(3)
driver.get_screenshot_as_file("login_capture.png")