-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest1.py
More file actions
42 lines (32 loc) · 1.42 KB
/
Test1.py
File metadata and controls
42 lines (32 loc) · 1.42 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
33
34
35
36
37
38
39
40
41
42
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
driver = webdriver.Chrome("c:\webdriver\chromedriver.exe")
driver.get("http://the-internet.herokuapp.com/")
driver.maximize_window()
driver.get("http://admin:admin@the-internet.herokuapp.com/basic_auth")
time.sleep(2)
driver.get("http://the-internet.herokuapp.com/")
time.sleep(1)
driver.find_element(By.XPATH, "//*[@href='/upload']").click()
driver.find_element(By.ID, 'file-upload').send_keys("C:/Photo/Anamorphic-Pro-Visual-Effects-Mac-Bundle.jpg")
time.sleep(1)
driver.find_element(By.ID, "file-submit").click()
time.sleep(2)
driver.get("http://the-internet.herokuapp.com/")
driver.execute_script("window.scrollTo(0,document.body.scrollHeight);")
driver.find_element(By.XPATH, "//*[@href='/download_secure']").click()
driver.find_element(By.XPATH, "//*[@href='download_secure/Anamorphic-Pro-Visual-Effects-Mac-Bundle.jpg']").click()
time.sleep(1)
driver.get("http://the-internet.herokuapp.com/")
driver.execute_script("window.scrollTo(0,document.body.scrollHeight);")
driver.find_element(By.XPATH, "//*[@href='/shifting_content']").click()
driver.find_element(By.XPATH, "//*[@href='/shifting_content/menu']").click()
driver.back()
time.sleep(2)
driver.find_element(By.XPATH, "//*[@href='/shifting_content/image']").click()
driver.back()
time.sleep(2)
driver.find_element(By.XPATH, "//*[@href='/shifting_content/list']").click()
driver.back()
driver.quit()