-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathselenium_browserstack.py
41 lines (36 loc) · 1.18 KB
/
selenium_browserstack.py
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
# @Author: Kristinita
# @Date: 2018-04-28 18:35:24
# @Last Modified time: 2020-09-18 08:38:33
"""BrowserStack + Selenium example test.
Demonstration test:
https://www.browserstack.com/automate
Get project name and badge key:
https://www.browserstack.com/automate/status-badges
Capabilities configuration:
https://www.browserstack.com/automate/capabilities
"""
import time
from selenium import webdriver
desired_cap = {
"os": "OS X",
"os_version": "High Sierra",
"browser": "Safari",
"browser_version": "11.0",
"project": "Simple Kristinita's Search",
"browserstack.local": "false",
"browserstack.debug": "true",
"browserstack.selenium_version": "3.10.0",
}
driver = webdriver.Remote(
command_executor="http://bsuser43877:sAKeQiprjVUqpWyaxcyp@hub.browserstack.com:80/wd/hub",
desired_capabilities=desired_cap,
)
driver.get("https://kristinita.netlify.app")
if "Поиск Кристиниты" not in driver.title:
raise Exception("Unable to load google page!")
elem = driver.find_element_by_tag_name("input")
elem.send_keys("Кристина Кива")
elem = driver.find_element_by_tag_name("button").click()
print(driver.title)
time.sleep(7)
driver.quit()