false false PROTOCOL ${__P(protocol,http)} = HOST ${__P(host,localhost)} = PORT ${__P(port,8765)} = CODE ${__P(code,ABCD)} = POLL_MS ${__P(pollms,2000)} = continue -1 false ${__P(users,100)} ${__P(rampup,60)} true ${__P(duration,300)} true ${HOST} ${PORT} ${PROTOCOL} UTF-8 10000 30000 false false User-Agent JMeter-Lasttest PAGE_VERSION NONE = VOTE_YES 0 = /p/${CODE}/state GET false true Accept application/json X-Requested-With XMLHttpRequest 200 Assertion.response_code false 8 VERSION $.version 1 NOT_FOUND ${POLL_MS} 500 ${__jexl3("${VERSION}" != "${PAGE_VERSION}" && "${VERSION}" != "NOT_FOUND")} false true /p/${CODE} GET true true 200 Assertion.response_code false 8 false CSRF name="csrf-token" content="([^"]+)" $1$ NOT_FOUND 1 groovy true def m = (html =~ re); m.find() ? m.group(1) : null } vars.put('PAGE_VERSION', first(/data-version="([^"]*)"/) ?: 'NOT_FOUND') def words = ['Zukunft', 'Teamgeist', 'Digital', 'Nachhaltig', 'Agil', 'Vertrauen', 'Mut', 'Tempo', 'Kommunikation', 'Fortschritt', 'Respekt', 'Kreativ', 'Klarheit', 'Wandel', 'Zusammenhalt', 'Qualität'] def texts = ['Mehr Praxisbeispiele bitte', 'Gerne kürzere Pausen', 'Alles gut so', 'Mehr Zeit für Fragen', 'Das Thema ist spannend', 'Bitte langsamer sprechen'] def slideId = first(/name="slide_id"[^>]*value="(\d+)"/) def parts = null def kind = '' // Wer schon geantwortet hat, sieht kein Formular mehr (nur "Deine Antwort ist angekommen"). if (slideId != null && !html.contains('class="done"')) { def order = [] def m = (html =~ /name="order\[\]" value="(\d+)"/) while (m.find()) { order << m.group(1) } def options = [] m = (html =~ /name="(option_ids?(?:\[\])?)" value="(\d+)"/) while (m.find()) { options << [m.group(1), m.group(2)] } def values = [] m = (html =~ /name="value" value="(\d+)"/) while (m.find()) { values << m.group(1) } if (order) { Collections.shuffle(order, rnd) parts = order.collect { 'order%5B%5D=' + it } kind = 'order' } else if (options) { def pick = options[rnd.nextInt(options.size())] parts = [(pick[0].startsWith('option_ids') ? 'option_ids%5B%5D=' : 'option_id=') + pick[1]] kind = 'choice' } else if (values) { parts = ['value=' + values[rnd.nextInt(values.size())]] kind = 'scale' } else if (html.contains('name="word"')) { parts = ['word=' + words[rnd.nextInt(words.size())]] kind = 'wordcloud' } else if (html.contains('name="question"')) { parts = ['question=' + java.net.URLEncoder.encode('Frage ' + rnd.nextInt(100000) + '?', 'UTF-8')] kind = 'qa' } else if (html.contains('name="text"')) { parts = ['text=' + java.net.URLEncoder.encode(texts[rnd.nextInt(texts.size())], 'UTF-8')] kind = 'open' } } if (parts != null) { vars.put('VOTE_BODY', (['slide_id=' + slideId] + parts).join('&')) vars.put('VOTE_KIND', kind) vars.put('VOTE_YES', '1') } else { vars.put('VOTE_YES', '0') } ]]> 1 0 0 2000 6000 ${__jexl3("${VOTE_YES}" == "1")} false true true false ${VOTE_BODY} = /p/${CODE}/vote POST false true Content-Type application/x-www-form-urlencoded; charset=UTF-8 X-CSRF-Token ${CSRF} X-Requested-With XMLHttpRequest "ok":true nicht mehr aktiv Assertion.response_data false 34 false saveConfig true true true true true true true false true true false false false true false false false true 0 true true true true true true