forked from naveenanimation20/Selenium-Python-TutorialsCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitchTo.py
More file actions
34 lines (25 loc) · 1.04 KB
/
switchTo.py
File metadata and controls
34 lines (25 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
driver.implicitly_wait(10)
'''frame handle'''
# driver.get('http://www.londonfreelance.org/courses/frames/index.html')
# frame_element = driver.find_element(By.NAME, 'main')
# #driver.switch_to.frame(frame_element)
# #driver.switch_to.frame(2)
# driver.switch_to.frame('main')
# header = driver.find_element(By.CSS_SELECTOR, 'body > h2').text
# print(header)
'''pop up handle'''
# driver.get('https://mail.rediff.com/cgi-bin/login.cgi')
# driver.find_element(By.NAME, 'proceed').click()
# alert = driver.switch_to.alert
# print(alert.text)
# alert.accept()
'''auth pop up'''
#driver.get('http://admin:[email protected]/basic_auth')
'''file upload pop up'''
driver.get('https://cgi-lib.berkeley.edu/ex/fup.html')
driver.find_element(By.NAME, 'upfile').send_keys('/Users/NaveenKhunteta/Desktop/MyWork.xml')