Created
March 27, 2018 15:47
-
-
Save elearningplugins/7db630b81dc073f989dd4d12710dd606 to your computer and use it in GitHub Desktop.
quick example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'selenium-webdriver' | |
driver = Selenium::WebDriver.for :chrome | |
wait = Selenium::WebDriver::Wait.new(:timeout => 15) | |
driver.manage.window.maximize | |
url = "https://mywebsite.com" | |
contact_case_url = url + "/support/contact/case" | |
driver.get url | |
driver.manage.timeouts.implicit_wait=(10) | |
driver.get contact_case_url | |
#GOLDEN PATH TEST CASE | |
#handle find your answer now modal | |
driver.find_element(:partial_link_text, "like to submit a case").click | |
driver.find_element(:id, "support_case_first_name").send_keys("First") | |
driver.find_element(:id, "support_case_last_name").send_keys("Last") | |
driver.find_element(:id, "support_case_email_address").send_keys("myemail@email.com") | |
#click on product dropdown | |
dropdown_product_name = driver.find_element(id: "support_case_product_name") | |
select_list = Selenium::WebDriver::Support::Select.new(dropdown_product_name) | |
select_list.select_by(:text, 'Storyline') | |
#click on product version dropdown | |
dropdown_product_version = driver.find_element(id: "support_case_product_version") | |
select_list = Selenium::WebDriver::Support::Select.new(dropdown_product_version) | |
select_list.select_by(:text, 'Storyline 360') | |
driver.find_element(:id, "support_case_description").send_keys("This is a description") | |
driver.find_element(:id, "support_case_forums_url").send_keys("awebsite.com") | |
#driver.find_element(:class, "btn--secondary btn--xsmall").click | |
driver.find_element(:id, "support_case_captcha").send_keys(math_captcha_answer) | |
#verify What info should you include? modal | |
driver.find_element(:partial_link_text, "What info should you include").click | |
got_it_button = driver.find_element(:xpath, "//SPAN[@class='btn--primary'][text()='Got It']") | |
got_it_button.click | |
sleep(60) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment