-
-
Save alisterscott/1218960 to your computer and use it in GitHub Desktop.
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' | |
require "benchmark" | |
d = Selenium::WebDriver.for :firefox | |
d.navigate.to "file:///#{Dir.pwd}/test.html" | |
e = d.find_element(:id => "q") | |
TESTS = 30 | |
Benchmark.bmbm do |results| | |
results.report("clear + send_keys:") { TESTS.times { | |
e.clear | |
e.send_keys("A LONG UPPER CASE STRING IS BEING SET") | |
} | |
} | |
end | |
d.quit |
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
C:\Projects\EtsyWatirWebDriver>gem install selenium-webdriver -v 2.5.0 | |
Fetching: selenium-webdriver-2.5.0.gem (100%) | |
Successfully installed selenium-webdriver-2.5.0 | |
1 gem installed | |
C:\Projects\EtsyWatirWebDriver>ruby bench.rb | |
Rehearsal ------------------------------------------------------ | |
clear + send_keys: 0.020000 0.120000 0.140000 ( 1.371973) | |
--------------------------------------------- total: 0.140000sec | |
user system total real | |
clear + send_keys: 0.010000 0.030000 0.040000 ( 1.642361) | |
C:\Projects\EtsyWatirWebDriver>gem install selenium-webdriver -v 2.6.0 | |
Fetching: selenium-webdriver-2.6.0.gem (100%) | |
Successfully installed selenium-webdriver-2.6.0 | |
1 gem installed | |
C:\Projects\EtsyWatirWebDriver>ruby bench.rb | |
Rehearsal ------------------------------------------------------ | |
clear + send_keys: 0.000000 0.390000 0.390000 (121.938344) | |
--------------------------------------------- total: 0.390000sec | |
user system total real | |
clear + send_keys: 0.000000 0.381000 0.381000 (121.711022) |
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
<html> | |
<body> | |
<input id=q type=text> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment