-
Notifications
You must be signed in to change notification settings - Fork 0
/
TC004_Admin_CRUD_User.py
47 lines (34 loc) · 1.25 KB
/
TC004_Admin_CRUD_User.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
44
45
46
47
#Author : Deepika
#Final Test Demo
import unittest
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
class TC004_Admin_CRUD_User(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome()
def test_login_feature(self):
user = "instructor"
pwd = "instructor1a"
driver = self.driver
driver.maximize_window()
driver.get("https://huskersapp.herokuapp.com/admin/")
time.sleep(1)
# Fetch the user ID and password by giving the below codes
elem = driver.find_element_by_id("id_username")
elem.send_keys(user)
elem = driver.find_element_by_id("id_password")
elem.send_keys(pwd)
elem.send_keys(Keys.RETURN)
time.sleep(1)
#Hit the login button to login to Admin Screen
driver.find_element_by_xpath("/html/body/div/div[2]/div/form/div[3]/input").click()
time.sleep(1)
#Click on the User Model in the Admin Screen
driver.find_element_by_xpath("/html/body/div/div[2]/div[1]/div[1]/table/tbody/tr[2]/th/a").click()
time.sleep(1)
def tearDown(self):
self.driver.close()
if __name__ == "__main__":
unittest.main()