jmeter login script?

jmeter login script?

by Paul Lindgreen -
Number of replies: 10
Picture of Particularly helpful Moodlers

hi , can someone please share a jmeter moodle login script for version moodle 3.5 and above that uses a text file with usernames/password to simply login?

My login script used to work as of moodle 3.3 but no longer works in v 3.5, looks like moodle handles logins differently now and I cant get it to work anymore.

I have a text file of usernames and passwords but cant seem to follow all of the forwarding (ajax) and session retrieval anymore in jmeter after logging in.

thanks

-----------------------

moodle 3.5

Average of ratings: -
In reply to Paul Lindgreen

Re: jmeter login script?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

I don't know the old system, the new format is just username,password per line.

I am discovering the new JMeter tools in Moodle - just documented a part of it: https://docs.moodle.org/dev/JMeter. Could you test it and ideally extend the page? You can log in to that wiki with the same credentials as on the moodle.org.
In reply to Visvanath Ratnaweera

Re: jmeter login script?

by Paul Lindgreen -
Picture of Particularly helpful Moodlers
Ive tried to use the generated script but it fails on the login page too.
The generated script looks like my own scripts so im not surprised it doesnt work for moodle 3.5.
In reply to Paul Lindgreen

Re: jmeter login script?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
You saw this at the bottom of https://docs.moodle.org/dev/JMeter#Make_JMeter_test_plan, right?

Attachment jmeter-testplan.png
In reply to Visvanath Ratnaweera

Re: jmeter login script?

by Paul Lindgreen -
Picture of Particularly helpful Moodlers
yup, passwords ticked, I downloaded both files and set the $CFG variable.
I then try to run the jmx file in jmeter but the login step fails
In reply to Paul Lindgreen

Re: jmeter login script?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
And you can login with those crendentials on the web interface?
In reply to Visvanath Ratnaweera

Re: jmeter login script?

by Paul Lindgreen -
Picture of Particularly helpful Moodlers
yes, the passwords were updated and I can login using the new password with those username's.

I am a fan of jmeter especially with the Blazemeter recording tools in Chrome but this login step really has me in a bind. If jmeter does not easily work with moodle nowadays can anyone recommend another free tool that does permit stress testing with a list of multiple logged in users?
In reply to Paul Lindgreen

Re: jmeter login script?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
JMeter simulates what a user's web browser would do when interacting with your site. I guess that how it simulate login was not changed since CSRF protection was added to the login form (see MDL-46764) and that is why it is failing. If this guess is right (which should be clear from the error you are getting - you need to check) then this should be fixable. I suggests you open a Tracker issue.
Average of ratings: Useful (2)
In reply to Paul Lindgreen

Re: jmeter login script?

by Mohamed Atia -
I am following the thread as I have the same issue with moodle 3.8 first time to use Jmeter but the login Request fails as described here
In reply to Mohamed Atia

Re: jmeter login script?

by Marc Kowal -
Not at my Testplan right now, but you should have a look at the additional "logintoken". You can, for testing purposes, disable the use of a logintoken in config.php.
Average of ratings: Useful (1)