-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.py
43 lines (33 loc) · 1.04 KB
/
test.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
42
43
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import time
desired_cap = {
'browser': 'Chrome',
'browser_version': '81.0 beta',
'os': 'Windows',
'os_version': '10',
'resolution': '1024x768',
'name': 'Bstack-[Python] Sample Test'
}
driver = webdriver.Remote(
command_executor='http://himanshukumar14:WnsNz7SsYbyT291rkPJr@hub.browserstack.com:80/wd/hub',
desired_capabilities=desired_cap)
driver.get('http://akashsuper2000.github.io/faculty-dashboard')
time.sleep(2)
username = driver.find_element_by_name('id')
username.send_keys('sample')
password = driver.find_element_by_name('password')
password.send_keys('password')
time.sleep(2)
subbut = driver.find_element_by_xpath("//input[@type='submit']")
subbut.click()
time.sleep(3)
subbut = driver.find_elements_by_xpath('//span[@class="Navbut"]')
for i in range(1,len(subbut)):
time.sleep(2)
subbut[i].click()
time.sleep(2)
time.sleep(2)
driver.quit()
print('Success')