Created
October 19, 2018 15:38
-
-
Save twalpole/4f5817cca42dba751e1e04baf16dd979 to your computer and use it in GitHub Desktop.
This file contains hidden or 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" | |
require "capybara/dsl" | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
sess = Capybara::Session.new(:selenium, app) # use firefox | |
# sess = Capybara::Session.new(:selenium_chrome, app) # use chrome | |
sess.visit("/") | |
sess.select('postgres') | |
sleep 20 | |
__END__ | |
<!doctype html> | |
<html> | |
<head> | |
<title>Some title</title> | |
</head> | |
<body> | |
<select id="db_select" oninput="alert('input fired')"> | |
<option value=""> Please select a driver</option> | |
<option value="mysql">mysql</option> | |
<option value="postgres">postgres</option | |
</select> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment