Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
85 views
in Technique[技术] by (71.8m points)

Parallel Test using Gatling

I have a scala file customized for one the flow, let us say from login, verification screen and home screen. I have many other workflows such as

1.login, verification screen, home and change address. 2.login, verification screen, home and change credit limit 3.login, verification screen, home and lost/stolen.

Below are my questions. Should I include the scala code for all the above workflows in one single scala file and call these as scenarios using setUp? or can the above flows be in separate scala files?

My End goal is to execute all the above flows in parallel, so that we can measure the load that the application can handle. Any examples/code is appreciated.

question from:https://stackoverflow.com/questions/65599543/parallel-test-using-gatling

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can split in many Scala files as you want, and then import into one single Simulation, eg:

object Scenario1 {
 val scenario = ???
}
object Scenario2 {
 val scenario = ???
}
class MySimulation extends Simulation {
 setUp(
   Scenario1.scenario.inject(???),
   Scenario2.scenario.inject(???),
 )
}

You should go through the official tutorials or the Gatling Academy, this is clearly demonstrated there.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...