-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmart_bot.py
More file actions
61 lines (33 loc) · 1.26 KB
/
smart_bot.py
File metadata and controls
61 lines (33 loc) · 1.26 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
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import pandas as pd
df = pd.read_csv('/Users/pranav_m/Documents/EY Smart Testing/testdata.csv')
driver = webdriver.Chrome('/Users/pranav_m/Documents/EY Smart Testing/chromedriver')
driver.get('https://www.sigfig.com/site/#/signup?next=%2Flanding')
result=[]
time.sleep(1)
for i in df.index:
entry = df.loc[i]
name_find = driver.find_element_by_name("username")
name_find.send_keys(entry['username'])
email_find = driver.find_element_by_name("email")
email_find.send_keys(entry['email'])
password_find = driver.find_element_by_name("password")
password_find.send_keys(entry['password'])
time.sleep(2)
submit_find = driver.find_element_by_xpath("/html/body/div[2]/content-wrapper/div/div/div/signup/div/div/form/button")
submit_find.click()
expected_string = "https://www.sigfig.com/f/#/plan/signup"
actual_string = driver.current_url
if (expected_string == actual_string){
result.append("Passed")
}
else{
result.append("Failed")
}
df['result'] = result
driver.close()
username_find.clear()
email_find.clear()
password_find.clear()username_find.clear()