How to simulate user do quiz multi choice use Jmeter !

How to simulate user do quiz multi choice use Jmeter !

by Tran The A n -
Number of replies: 19

Hi !

I'm student, I have a problem with Jmeter to perform  Test performance of Moodle. I need simulate multi user (student) perform multichoice test !

I use HTTP(s) Test Script Recorder to record script and run this script, i access to page /mod/quiz/report.php?id=3&mode=overview to find user inprosess but i can't see any user, i used HTTP Cookie Manager to manage cookie, in the View Results Tree Listener show "success" all request ! I see "sesskey" variable same in all requests.

Please show me some solutions to resolve this problem ! What component of  jmeter to be use ? how to simulate student perform Multichoice test same reality !

Best regards !

(Sorry ! My english is not good  !)

 

Average of ratings: -
In reply to Tran The A n

Re: How to simulate user do quiz multi choice use Jmeter !

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Sesskey will be different each time you log in (but should stay the same throughout a login session).

What you need to do is use an "XPath Extractor" in JMeter to get the sesskey from the one of the pages that is loaded after login. Here is a screen-grab of a how I did it in one script.

That script is the one here: https://github.com/maths/moodle-qtype_stack/tree/master/jmeter

 

Average of ratings: Useful (3)
In reply to Tim Hunt

Re: How to simulate user do quiz multi choice use Jmeter !

by Tran The A n -

Thank for your reply ! I will try it, if i have any problem, i will ask you again smile ! Thank you so much !

In reply to Tim Hunt

Re: How to simulate user do quiz multi choice use Jmeter !

by Tran The A n -

Dear Tim Hunt !

Hi !

I did same what you instructed and have problems i meet:

This is screen :

all response data have a same "sesskey", I do not know why response "Can not find data record in database table quiz_attempts" !

After, i go to Moodle page:

 

I see user7@gmail.com still in "In progress". About more 20 mins user7@gmail.com finished (although I seted time to complete exam is 20 mins).

Please tell me what problems i met and could you tell me a solution ! I want Jmeter simulate Student do exam same reality!

 

This is Testplan file and Listener file:

https://drive.google.com/file/d/0B-jyWX-PzulCMWJkV3lFbGNGRjg/edit?usp=sharing

 

I am waiting for your help ! I must finish my thesis next 3 days ! Please help me !

 

Best regards !

 

 

 

In reply to Tran The A n

Re: How to simulate user do quiz multi choice use Jmeter !

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Note that each question attempt gets its own id, which you need to know to let JMeter continue the attempt. I would guess you are not getting the correct id to use later in the script.

Average of ratings: Useful (2)
In reply to Tim Hunt

Re: How to simulate user do quiz multi choice use Jmeter !

by srikanth raju -

Hi Tim,

        I am also facing same problem. When i tried to run for 10 users, it is working fine. Then later i changed number of users from 10 to 50 then i am getting same error like "cannot find data record in database table quiz attempts" in jmeter.

 Can you please tell, why this happen when i changed the number of users ?

Thanks

Raju

In reply to srikanth raju

Re: How to simulate user do quiz multi choice use Jmeter !

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Presumably your server is getting overloaded. On reasonably hardware, it is perfectly possibly to run quizzes with several hundred users. (Last week we ran an exam with 50 users at the same time, and server load never got above 5%.)

So, checkout out http://docs.moodle.org/27/en/Performance_recommendations. Also, learn how to monitor your server, so when something goes wrong, you know where the problem is. That involves a monitoring system like Nagios to monitor the hardware and operating system, and turning on Moodle's errorr logging to log errors to the server log file.


Average of ratings: Useful (1)
In reply to Tim Hunt

Re: How to simulate user do quiz multi choice use Jmeter !

by Faisal Jamil -

Hi Tim,

I did same what you instructed and have problems i meet when i execute this script.:


See this screen.

Attachment quizattempt.png
In reply to Faisal Jamil

Re: How to simulate user do quiz multi choice use Jmeter !

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

That error does not look very relevant. It is complaining that the XML parser does not know the entity   which is true, but irrelevant. However, that may be breaking other things. See if you can inspect the source of the mod/quiz/view.php page, find that entity, and remove it. (Replace it with an ordinary space, or  .

The errors from processattempt.php are more likely to be interesting.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: How to simulate user do quiz multi choice use Jmeter !

by Faisal Jamil -

Hi Tim,

Thank for your reply ! I will try it, if i have any problem, i will ask you again smile !

Thank you

In reply to Tim Hunt

Re: How to simulate user do quiz multi choice use Jmeter !

by Donatien Vrielynck -

Hello Moodle community,


For a week, I'm busy testing a server Moodle 2.4.1+ (Build: 20130208) with Apache JMeter for Quiz activity.

Historically, it played a key server role for the selection of our students in our school of engineering for the selection contest. 

This server filled out its function. Today, the selection changes mode and the server will be updated, modified, ect ...


Last week, we made the "Quiz" with over 100 students and server truly suffered ... 

So I looked at the optimization "Apache, MySQL, PHP5" ... and the creation and use of test with "JMeter".


The creation of test plan simulating students browsing the server through various activities running smoothly.

However, I encounter a difficulty to date on the creation of a test plan of the Quiz activity ...

I overcame various difficulties but I am confronted with a problem.


When creating the simulation of a quiz in "JMeter", with the tool "HTTP (S) Script Recorder Test", I can go to the home page, log me see my courses, see my Quiz, start My Quiz ... but when I want to validate my answers I get the following error message:

"A required parameter (Attempt) is missing" !!!


This error does not appear when running a Quiz in Moodle.

All quizzes that have been made this far gone well.


This error occurs only with JMeter. !!!

But this error does not allow me to complete my test plan, and therefore, performing load testing on this server.

Somebody can help me?


Looking forward to your answers.

Thank you in advance.

Donatien

Attachment JMeter_Error_processattempt2.jpg
In reply to Donatien Vrielynck

Re: How to simulate user do quiz multi choice use Jmeter !

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Trying to record a test attempt using JMeter's recording tool will not work. (Though the fact it failed to record the attempt parameter does not make sense. It should be able to record that for the attempt you made.) However, each attempt you made will get a different attempt number, so your recording will be useless.

You need a tool like Admin -> Development -> Make JMeter test plan. However, unfortunately at the moment that tool can only generate scripts for Forums and Pages.

At the OU we have a script that can generate JMeter scrips for various activities, mostly ou-specific ones, but it does include quizzes. I don't want to share the whole plugin, because it is written in a weird way, and is a big ou-specific, but I have attached the file generates the quiz bit of the JMeter script. It would be really good to get that re-writted to fit into Moodle's official test-plan generator. Anyway, it should show you the sort of code that is required.

Average of ratings: Useful (3)
In reply to Tim Hunt

Re: How to simulate user do quiz multi choice use Jmeter !

by Donatien Vrielynck -

Hello Tim,

Firstly thank you for your answer.

Regarding "Admin -> Development -> Make JMeter test plan" this tool is present in the Moodle version 2.5 and above, or the server that I test with JMeter is currently in version 2.4.1. As you say this tool test as forums and pages. I know these tests with JMeter currently achieve on my server.


My hope was to make a JMeter test plan on the Quiz activity with 1 single user and adapt with 10, 25, 50, 75 and 100 users and more ... to define from what point server was overloaded. Next, I will build a new server Quiz Moodle version 2.8 or + that I would submit to JMeter tests and I will build accordingly.

But if I can not complete my first JMeter test plan on the Quiz activity with a single user I can not continue in this direction. sad

What is strange is that while the test plan works well when it is the GET method but I am facing this error for the unique POST method.

Here are the contents of the request of the POST method:

POST http://qcm.telecom-lille.fr/mod/quiz/processattempt.php


--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 1_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 1_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 1_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 1_answer"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 2_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 2_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 2_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 2_answer"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 3_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 3_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 3_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 3_answer"


2

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 4_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 4_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 4_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 4_answer"


3

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 5_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 5_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 5_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 5_answer"


4

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 6_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 6_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 6_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 6_answer"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 7_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 7_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 7_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 7_answer"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 8_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 8_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 8_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 8_answer"


2

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 9_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 9_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 9_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 9_answer"


3

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 10_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 10_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 10_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 10_answer"


4

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 11_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 11_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 11_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 11_answer"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 12_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 12_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 12_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 12_answer"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 13_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 13_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 13_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 13_answer"


2

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 14_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 14_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 14_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 14_answer"


3

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 15_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 15_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 15_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 15_answer"


4

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 16_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 16_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 16_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 16_answer"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 17_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 17_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 17_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 17_answer"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 18_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 18_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 18_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 18_answer"


2

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 19_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 19_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 19_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 19_answer"


3

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 20_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 20_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 20_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 20_answer"


4

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 21_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 21_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 21_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 21_answer"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 22_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 22_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 22_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 22_answer"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 23_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 23_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 23_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 23_answer"


2

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 24_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 24_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 24_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 24_answer"


3

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 25_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 25_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 25_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 25_answer"


4

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 26_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 26_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 26_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 26_answer"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 27_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 27_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 27_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 27_answer"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 28_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 28_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 28_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 28_answer"


2

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 29_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 29_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 29_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 29_answer"


3

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 30_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 30_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 30_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 30_answer"


4

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 31_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 31_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 31_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 31_-seen"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 32_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 32_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 32_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 32_answer"


gehen

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 33_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 33_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 33_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 33_answer"


wechseln

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 34_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 34_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 34_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 34_answer"


machen

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 35_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 35_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 35_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 35_answer"


bekommen

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 36_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 36_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 36_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 36_answer"


abschliessen

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 37_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 37_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 37_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 37_answer"


arbeiten

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 38_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 38_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 38_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 38_answer"


gründen

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 39_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 39_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 39_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 39_answer"


haben

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 40_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 40_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 40_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 40_answer"


werden

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 41_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 41_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 41_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 41_answer"


finden

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 42_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 42_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 42_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 42_-seen"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 43_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 43_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 43_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 43_answer"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 44_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 44_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 44_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 44_answer"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 45_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 45_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 45_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 45_answer"


2

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 46_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 46_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 46_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 46_answer"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 47_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 47_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 47_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 47_answer"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 48_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 48_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 48_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 48_answer"


2

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 49_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 49_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 49_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 49_answer"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 50_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 50_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 50_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 50_answer"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 51_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 51_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 51_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 51_answer"


2

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 52_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 52_: flagged"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 52_: sequencecheck"


1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "q4982: 52_answer"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "next"


following

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "attempt"


2799

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "thisPage"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "nextpage"


-1

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "timeUp"


0

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "sesskey"


LwtaWmjmOy

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "scrollpos"



--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ

Content-Disposition: form-data; name = "slots"


1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52

--qsbkA_cfNdSBU8umup2zs3e6LiUPYJ--


And here the request headers:

Connection keep-alive

Referer http://qcm.telecom-lille.fr/mod/quiz/attempt.php?attempt=2799

Accept-Language fr, en-US; q = 0.7 in; q = 0.3

Accept-Encoding gzip, deflate

User-Agent Mozilla / 5.0 (X11; Ubuntu, Linux x86_64; rv: 40.0) Gecko / 20100101 Firefox / 40.0

Accept text / html, application / xhtml + xml, application / xml; q = 0.9, * / *; q = 0.8

Content-Length 21301

Content-Type multipart / form-data; boundary = qsbkA_cfNdSBU8umup2zs3e6LiUPYJ; charset = UTF-8

Host qcm.telecom-lille.fr


As we can see, the parameter "attempt" is present in the request the POST method and its value "2799" is the one present in the request headers.


Here is a Quiz with 50 questions arranged on a single page.

However, I have the same error with another quiz, one question per page, as soon as I go to the next page.


I really do not understand why a single attempt by a single user completes this error?


With regard to the file "lib.php"

First of all thank you Tim.

If I want to use it or do I put it in my file tree moodle?


Thank you again for your answer.

Donatien

In reply to Donatien Vrielynck

Re: How to simulate user do quiz multi choice use Jmeter !

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I think the explanation is that that POST request is very, very, long, and the attempt parameter is very near the end.

Probably, something is limiting the size of POST requests, and therefore it is getting chopped off before the attempt parameter, so the server does not see it and sends the error.

You can't use the lib.php file I attached. All you could do is use it as inspiration, to see what bits of Jmeter file you need to generate in your own code if you want to automatically generate tests of a quiz.

Average of ratings: Useful (2)
In reply to Tran The A n

Re: How to simulate user do quiz multi choice use Jmeter !

by npmba np -

Hi Tran The A n


Have you been able to save the recorded answers in the jmeter quiz testcase??

If yes, how did you resolve the issue.


Regards

Nandini

In reply to npmba np

Re: How to simulate user do quiz multi choice use Jmeter !

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Trying to record a quiz attempt using JMeter won't work. The ids in the submitted data change every time you attempt the quiz. You need to script it.

Things that change each attempt:

  • sesskey - you need to use a regex to get this out of the HTML of page after the user has logged in.
  • attemptid - after the request to startattempt.php, you need to use a regex to get this out of the page HTML of the next page.
  • For all the parameters like q4982:46_answer, the 4982 bit changes each quiz attempt.


Average of ratings: Useful (3)
In reply to Tim Hunt

Re: How to simulate user do quiz multi choice use Jmeter !

by npmba np -

Hi Tim

Thanks for the reply.

This was what I did

sesskey: Extracted through regex and passed it wherever necessary

attemptid: Extracted through regex  with reference name "attempt", and passed it wherever necessary

for parameters like  q4892:46_answer, I figured that the numeric bit after q is the same as attempt id ,so I passed the parameters q${attempt}:1_:sequencecheck 


In this way, I'm able to submit the test but not record the answers.


Just to clarify your point, it is not possible to use the http proxy recorder for quiz test cases, but i have to script the test in php and  somehow upload the script to jmeter is that correct??


In reply to npmba np

Re: How to simulate user do quiz multi choice use Jmeter !

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The number in q4892:46_answer is not the same as attempt id. I suppose it might be when you very first install a Moodle site, but as soon as you preview a question in the question bank (to give just one example) it will no longer match.

You don't have to write PHP to generate the JMeter scrips. You can write the JMeter script by hand, as you did.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: How to simulate user do quiz multi choice use Jmeter !

by npmba np -

Ah that was super silly of me!! Thankss a lott.

It worked after I changed the numeric bit parameter .

Thanks again smile 

In reply to npmba np

Re: How to simulate user do quiz multi choice use Jmeter !

by Jan Derriks -

It took me hours to find out why my JMeter (recorded+edited) script did not seem to push the right values for questions.
The scripts ran fine but all the questions remained unanswered.

It turned out that Jim Hunt's Regex Extractor example from the stack101.jmx file cannot be used for quizzes with more than 1 question. In the stack101.jmx example it says:

...

<stringProp name="RegexExtractor.regex">name=&quot;(q\d+:1_):sequencecheck&quot;</stringProp>

..

And this will only work with one question, numbered :1. So I changed it into:

name=&quot;(q\d+):1_:sequencecheck&quot;

And if you add the three regex JMeter post-processor parts on the right place in your recorded JMX file it will work after some more text-editing to:

  • replace every session key occurrence with ${sesskey} (session keys look like JN9Xa5r5bd)
  • replace every literal attempt number with ${attemptid}
  • replace every question prefix with ${varprefix} like in: ${varprefix}:2_:flagged

You can use any text editor to do the find+replace. You can also use the JMeter gui and change all the arguments one by one but that is a lot more work.

If the script works, use JMeter gui to remove requests for things like themes and javascript that are not needed to clean up.

So the basic steps to record+play a JMeter script for a quiz:

  1. Start the jmeter recorder and do the quiz: log in, navigate to the quiz, answer the questions, finish, logout, stop recorder. Note: dont use random generated questions if you want stable results.
  2. Add jmeter regex rules for extraction of SESSKEY, VARPREFIX and ATTEMPTID. Put the sesskey regex in the login/index.php request and the other two in the startattempt.php request. You can choose if you do it with JMeter gui or by editing the jmx file.
  3. Replace the occurrences of the real sesskey string, attempt numbers and question prefixes like q1728 with their variables.
  4. Save script.
  5. Keep "view result tree" JMeter window visible and click start/replay. Start with 1 thread and a loop count of 1 because you probably forgot to edit one or two attempt numbers or session key's.


I added an example to copy parts from. This example uses localhost as it is tested with moodle 2.9 on XAMPP.
It uses a quiz with thee questions: numerical, multiple choice and a simple text.





Attachment jmeterquiz.PNG
Average of ratings: Useful (5)