Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
ruby-jmeter sample
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]' => 'qqqq@qqqq.com',
'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