-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtokopediaUserCreation.rb
78 lines (56 loc) · 1.79 KB
/
tokopediaUserCreation.rb
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
67
68
69
70
71
72
73
74
75
76
77
78
require "selenium-webdriver"
#Chrome browser instantiation
prefs = {
'credentials_enable_service' => false,
'profile.password_manager_enabled' => false
}
driver = Selenium::WebDriver.for :chrome, prefs: prefs
#driver = Selenium::WebDriver.for :chrome
#Loading the assertselenium URL
driver.navigate.to "https://www.tokopedia.com"
#Clicking on the Follow link present on the assertselenium home page
FollowButton = driver.find_element(:link, "Daftar")
FollowButton.click
#Typing the Name
FullName = driver.find_element(:id, "full-name")
FullName.send_keys "xxx hdjfhdsjh"
sleep 5
#Typing Phone Number
Phone = driver.find_element(:id, "phone")
Phone.send_keys "1234-5678-1111"
sleep 5
#Typing Email
Email = driver.find_element(:id, "email")
Email.send_keys "[email protected]"
sleep 5
#Typing Password
Password = driver.find_element(:id, "password")
Password.send_keys "12345678"
sleep 5
#Selecting Gender
driver.find_element(:id, "gender-female").click
sleep 5
#wait = Selenium::WebDriver::Wait.new(:timeout => 10)
#Selecting Date
driver.find_element(:id, "sel-date").find_element(:css, "option[value='2']").click
sleep 5
#Selecting Month
driver.find_element(:id, "sel-month").find_element(:css, "option[value='2']").click
sleep 5
#Selecting Year
driver.find_element(:id, "sel-year").find_element(:css, "option[value='1986']").click
sleep 5
#Clicking on the Submit Button
SubmitButton = driver.find_element(:id, "register-button")
SubmitButton.click
#wait = Selenium::WebDriver::Wait.new(:timeout => 15)
#Asserting whether the Login is pass or Fail
#SuccessMessage = driver.find_element(:link, "Masuk")
#if "Masuk.".eql? SuccessMessage.text
#puts "Successfully Logged in"
#else
# puts "Failed"
#end
#Quitting the browser
#wait = Selenium::WebDriver::Wait.new(:timeout => 15)
#driver.quit