gatling

How to pass value between two scenarios in gatling?

谁说我不能喝 提交于 2019-12-10 10:48:34
问题 I have two scenarios in my script. I want to pass value of "CreateId" to 2nd scenario. I have saved "CreateId" in 1st scenario. Error says: No attribute named 'CreateId' is defined jsonPath($.id).find(0).exists, found nothing Scenario - 1 val create = scenario("Create") .exec(http("post_request_create") .post("/api/asdf") .headers(headers_10) .body(StringBody(session =>s"""{"name": "${randomName()}"}""")).asJSON .check(jsonPath("$.id") .saveAs("CreateId")) ) Scenario - 2 val addTerm =

Build executable JAR for Gatling load test

ε祈祈猫儿з 提交于 2019-12-09 08:23:35
问题 I am new to Gatling (2.1.2) and want to do a small prototype project to show to my colleagues. According to the quick start page, there are several ways I can run a simulation with Gatling: decompress the Gatling bundle into a folder and drop my simulation files into user-files/simulations folder. bin/gatling.sh will compile and run the simulation files. use the gatling-maven-plugin maven plugin to execute the simulation. create a project with gatling-highcharts-maven-archetype , and run the

Gatling check for java.io.IOException: Remotely closed

拜拜、爱过 提交于 2019-12-08 19:49:29
问题 While doing a test in gatling I get the following error java.io.IOException: Remotely closed which is expected (server cuts connection). How do I mark the test success or check for that exception? 回答1: This exception means that the server closed the connection when the client (Gatling) was trying to write on it. This might be in indication that you have to tune your keep-alive timeout to NOT match typical user think time, but such event will always happen. But then, web browsers retry sending

Gatling. Fetch data from response for next requests

旧城冷巷雨未停 提交于 2019-12-08 17:49:27
I need to fetch optional data from a JSON response to build next requests. I use check(jsonPath("...rooms[0].id").exists.saveAs("...roomId")) but if the user has no rooms, the result is interpreted by .check() as an error (e.g. request count 4 (OK=3 KO=1) ) object Users { val execute = exec(http("Users")) .get("/api/user?userIdentifier=${userId}") // if user has no rooms, the check results in an error (KO) .check(jsonPath("$..user.rooms[0].id").exists.saveAs("roomId")) .pause(1) } object Room { val execute = exec(http("Room")) .get("/api/room?id=${roomId}") .pause(1) } val readOnlyScenario =

Gatling. Check, if a HTML result contains some string

限于喜欢 提交于 2019-12-06 13:41:42
问题 Programming Gatling performance test I need to check, if the HTML returned from server contains a predefined string. It it does, break the test with an error. I did not find out how to do it. It must be something like this: val scn = scenario("CheckAccess") .exec(http("request_0") .get("/") .headers(headers_0) .check(css("h1").contains("Access denied")).breakOnFailure() ) I called the wished features "contains" and "breakOnFailure". Does Gatling something similar? 回答1: Better solutions: with

gatling系列教程(翻译)-第四节(高级教程)

旧时模样 提交于 2019-12-06 12:23:50
在本节中,我们假设您已经通过了“快速入门”部分,并且有一个基本的模拟可以使用。 我们将应用一系列重构来引入更先进的概念和DSL结构。 步骤01:隔离进程 目前我们的模拟是一个大的整体场景。 所以首先让我们把它分解成可组合的业务流程,类似于Selenium的PageObject模式。 这样,您就可以轻松地重用一些零件并构建复杂的行为,而不会牺牲维护。 在我们的方案中,我们有三个分离的过程 搜索:按名称搜索模型 浏览:浏览模型列表 编辑:编辑给定的模型 我们将提取这些链并将其存储在对象中。 对象是原生Scala单身。 您可以创建专用文件,或直接在与模拟相同的文件。 object Search { val search = exec(http("Home") // let's give proper names, as they are displayed in the reports .get("/")) .pause(7) .exec(http("Search") .get("/computers?f=macbook")) .pause(2) .exec(http("Select") .get("/computers/6")) .pause(3) } object Browse { val browse = ??? } object Edit { val edit = ??? }

Debugging the session

自闭症网瘾萝莉.ら 提交于 2019-12-06 10:38:53
问题 As part of my performance testing, I need to debug the session etc. The same code is running if I remove session => . When I add that it says there was no request sent during simulation since it is not sending any. val scn1 = scenario("LaunchAction").exec{ session => http("Poll report status page report") .get("myURL/rest/reports") .queryParam("applicationId", "123") .queryParam("id", "1") .check(xpath("//status").saveAs("responseStatus")) session } I need to add few prints etc in between.

Why increasing worker_connections in Nginx makes the application slower in node.js cluster?

青春壹個敷衍的年華 提交于 2019-12-06 08:25:33
问题 I'm transforming my application to node.js cluster which I hope it would boost the performance of my application. Currently, I'm deploying the application to 2 EC2 t2.medium instances. I have Nginx as a proxy and ELB. This is my express cluster application which is pretty standard from the documentation. var bodyParser = require('body-parser'); var cors = require('cors'); var cluster = require('cluster'); var debug = require('debug')('expressapp'); if(cluster.isMaster) { var numWorkers =

Increasing connection timeout for Tomcat in Spring Boot

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 03:29:08
问题 How can timeout be increased so that till response is processed, request does not timeout? Tomcat settings in Spring Boot: server.tomcat.max-connections=2000 server.tomcat.max-threads=200 server.connection-timeout=1200000 Request per second were raised constantUsersPerSec(20) during (15) to 300 during course of 15 seconds and all requests were served as can be seen in plot below from gatling(blue). scn.inject( constantUsersPerSec(20) during (15), ) This is due to max-connections = 2000 which

ssl - Error self signed certificate getting chain

空扰寡人 提交于 2019-12-06 02:49:34
问题 I'm learning to use Gatling to test scenario I've been doing with guide from documentation here http://gatling.io/docs/2.1.7/http/recorder.html Because my to-be-tested scenario includes logging in with Google Account, it is rejected due to lack of certificate. I followed guidelines to generate a certificate openssl genrsa -out rootCA.key 2048 openssl req -x509 -new -nodes -key rootCA.key -days 1 -out rootCA.pem openssl x509 -outform der -in rootCA.pem -out gatlingCA.crt openssl genrsa -out