-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcansr_information4.py
More file actions
72 lines (47 loc) · 1.77 KB
/
Copy pathcansr_information4.py
File metadata and controls
72 lines (47 loc) · 1.77 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import time
from selenium import webdriver
from selenium.webdriver import ActionChains
#create instance for chrome browser
driver = webdriver.Chrome()
# browser.get to navigate to page
driver.maximize_window()
driver.get('https://www.cansrdev.com/clinical/dashboard/')
#verify title of the page
if(driver.title=="Cansr | Login"):
print("Success: Cansr page logged")
else:
print("Failed: Cansr page cannot be opened")
time.sleep(2)
#find email path using xpath
email=driver.find_element_by_xpath("//input[@id='inp_loginid']")
#send text to element
email.send_keys('abbie1hobbs@yopmail.com')
#find password element using xpath
password=driver.find_element_by_xpath("//input[@id='inp_password']")
password.send_keys('Abbieh@1')
time.sleep(3)
#select login button
login = driver.find_element_by_xpath("//button[text()='Login']")
login.click()
time.sleep(5)
#my account
account=driver.find_element_by_xpath("//a[@id='newmyProfileLink-old']")
time.sleep(3)
account.click()
#click registration
cont_register=driver.find_element_by_xpath("//a[@id='newmyProfileLinkRenamed']")
cont_register.click()
time.sleep(3)
next=driver.find_element_by_xpath("//body/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/form[1]/div[1]/div[3]/ul[1]/li[2]/a[1]")
next.click()
time.sleep(3)
#cansr info 4/4
cansr_info=driver.find_element_by_xpath("//body/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/form[1]/div[1]/div[2]/section[3]/div[1]/div[1]/ul[1]/li[4]")
cansr_info.click()
time.sleep(3)
Q9=driver.find_element_by_xpath("//textarea[@id='related_comment']")
Q9.send_keys('Contiune with same treatment')
time.sleep(3)
next=driver.find_element_by_xpath("//body/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/form[1]/div[1]/div[3]/ul[1]/li[2]/a[1]")
next.click()
time.sleep(3)