Class: NarouAgent::Actions::Login
- Inherits:
-
NarouAgent::Action
- Object
- NarouAgent::Action
- NarouAgent::Actions::Login
- Defined in:
- lib/narou_agent/actions/login.rb
Constant Summary
Constants included from UrlHelper
Instance Method Summary collapse
Methods inherited from NarouAgent::Action
Methods included from UrlHelper
Constructor Details
This class inherits a constructor from NarouAgent::Action
Instance Method Details
#run(id, password) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/narou_agent/actions/login.rb', line 4 def run(id, password) driver.get(login_url) driver.find_element(name: 'narouid').send_keys(id) driver.find_element(name: 'pass').send_keys(password) driver.find_element(id: 'mainsubmit').click # Confirm logging in succeeded driver.find_element(id: 'userid') rescue Selenium::WebDriver::Error::WebDriverError => e raise ActionFailedError.new(e) end |