I can’t find the solution to build a feeder from the received html. I have a table with links and want to send this links to the next step (I can’t guess the links) :
request 1: query that URL that provides some links
request “question-1.html”
…
request “question-n.html”
This means that all users will go thru the scenario, so, all users will access all questions. Or, is the user1 only supposed to access question1, user2 access question2 etc ?
So, if you change that to :
css(".view-id-bonita_q_a.view-display-id-panel_pane_1 .view-content .bonita-views-qa-rows .views-field-qa-title a", “href”).findAll.saveAs(“allLinks”)
Yes, that’s better.
The end of the line “filter[…]” select only the values which not contains “community”, I only want to exclude it from the value. Like substr($value, 0, 10) with PHP.
Nicolas,
I’ve actually have similar situation - some data (list of ids) is requested form a service to be used in test.
Is there a way to share this data between users? So that only one request was made to get data.
I’ve tried to store the data in a var and check if it is there so that the first user checks the var, sees its empty and requests the data and stored it. Then the second user checks the var, sees it has data and does not requests but uses it.
Can Gatling work such way or the data should be requested before the simulation starts? So far it seems that even when
e.g.
val scn = scenario(“request by id”)
.exec( doIf( data.isEmpty){ .exec(GetData) }) // Get test data
def getData =
exec(http( “Get ids list form service”)
.get("""/idservice&limit=400""")
.headers( auth )
.check(jsonPath("$.data…id").findAll.saveAs(“ids”)))
.exec(session => data=session(“ids”).as[Seq[Int]])
3/ Also, note that this code may not give you “only one request”, but one or a few.
Indeed, between the test and the set of the “data” variable, some time may be elapsed.
Is this enough of a tradeoff for you ?