Created
November 23, 2014 07:00
-
-
Save mahm/5c565a2f1a1146dd2987 to your computer and use it in GitHub Desktop.
ruby-jmeter sample
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 'ruby-jmeter' | |
test name: 'JMX Sample' do | |
threads count: 5, loops: 5 do | |
cookies | |
visit name: 'Login Page', url: 'http://0.0.0.0:3000/users/sign_in' do | |
extract name: 'csrf-token', xpath: "//meta[@name='csrf-token']/@content", tolerant: true | |
extract name: 'csrf-param', xpath: "//meta[@name='csrf-param']/@content", tolerant: true | |
end | |
http_header_manager name: 'X-CSRF-Token', value: '${csrf-token}' | |
submit name: 'Login', url: 'http://0.0.0.0:3000/users/sign_in', | |
fill_in: { | |
'${csrf-param}' => '${csrf-token}', | |
'user[email]' => '[email protected]', | |
'user[password]' => 'qqqqqqqq' | |
} | |
visit name: 'Project', url: 'http://0.0.0.0:3000/projects/1' | |
visit name: 'Tasks', url: 'http://0.0.0.0:3000/projects/1/tasks/current' | |
end | |
view_results_in_table | |
graph_results | |
aggregate_graph | |
# Debug | |
# debug_sampler | |
# view_results_tree | |
end.jmx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment