-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest1.py
More file actions
22 lines (17 loc) · 738 Bytes
/
test1.py
File metadata and controls
22 lines (17 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import pytest
import time
from selenium.webdriver.common.by import By
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.service import Service
browser = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
def test_open():
# browser.get('https://suninjuly.github.io/xpath_examples')
# time.sleep(5)
browser.get('http://suninjuly.github.io/cats.html')
# bullet_cat = browser.find_element(By.XPATH, "//*[contains(text(), 'Bullet cat')]")
view_button = browser.find_elements(By.XPATH, "//*[contains(text(), 'View')]")
print(view_button)
assert len(view_button) == 6, "Wrong length"
def test_open_page():
test_open()