-
Notifications
You must be signed in to change notification settings - Fork 0
/
examples.rb
39 lines (28 loc) · 1.25 KB
/
examples.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
## click on image with class
# driver.find_element(:class, "tenant-logo").click
## click on link with text
# driver.find_element(:link_text,'Contact').click
# driver.find_element(:link_text,'Works').click
## click on link with href
# driver.find_element(:xpath,'//a[@href="/users/sign_in?locale=en"]').click
## wait for element to appear
# wait = Selenium::WebDriver::Wait.new(:timeout => 2)
# wait.until{driver.find_element(:link_text, 'Dashboard').click}
## click on sign in through xpath
# driver.find_element(:xpath,'//a[@href="/users/sign_in?locale=en"]').click
## log in
# driver.find_element(:id, 'user_email').send_keys('support@notch8.com')
# driver.find_element(:id, 'user_password').send_keys('testing123')
# driver.find_element(:name, 'commit').click
## returns page source
# p driver.page_source
## log into main page
# driver.get('https://samvera:hyku@mola.bl-staging.notch8.cloud/')
## reset current page source to current url
# driver.get(driver.current_url)
## finding by xpath with 'and'
# driver.find_element(:xpath, '//input[@type="radio" and @value="Article"]').click
## running windowless mode
# https://sqa.stackexchange.com/questions/2609/running-webdriver-without-opening-actual-browser-window
## maximize window
# driver.manage.window.maximize