-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwaitForElements.py
More file actions
35 lines (20 loc) · 914 Bytes
/
waitForElements.py
File metadata and controls
35 lines (20 loc) · 914 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
28
29
30
31
32
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import unittest
class WaitForElements(unittest.TestCase):
def setUp(self):
global driver
driver = webdriver.Firefox()
driver.get("http://travelingtony.weebly.com")
def test_WaitForCheckOutPhotosButton(self):
bLocator = "//span[.='Check out my coolest photos']"
seebutton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, bLocator)))
def test_WaitForSearchField(self):
sLocator = "input.wsite-search-input"
sField = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.CSS_SELECTOR, sLocator)))
def tearDown(self):
driver.quit()
if __name__ == "__main__":
unittest.main()