-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframe.py
More file actions
29 lines (20 loc) · 819 Bytes
/
Copy pathframe.py
File metadata and controls
29 lines (20 loc) · 819 Bytes
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
#switch_to_frame(name)
#switch_to_frame(id)
#switch_to_default_content()
from selenium import webdriver
import time
driver=webdriver.Chrome('chromedriver.exe')
driver.maximize_window()
driver.get('https://seleniumhq.github.io/selenium/docs/api/java/index.html')
#switch_to_frame('Name of the frame')
driver.switch_to_frame('packageListFrame')
driver.find_element_by_link_text('com.thoughtworks.selenium.webdriven').click()
time.sleep(5)
#switch to main page //Basically used when switch from one frame to other frame
driver.switch_to_default_content()
driver.switch_to_frame('packageFrame')
driver.find_element_by_link_text('FunctionDeclaration').click()
time.sleep(5)
driver.switch_to_default_content()
driver.switch_to_frame('classFrame')
driver.find_element_by_xpath('/html/body/div[1]/ul/li[5]/a').click()