Run jBehave story n number of times - selenium

I have a jBehave/Selenium story which has certain steps (e.g. to create a record)
Now I want the same steps to be run n number of times (i.e. i want to create n records)
How can I do that in jBehave?
I am using Selenium WebDriver.

I think the normal way to execute the steps in a story n number of times is to have an examples table containing n rows: http://jbehave.org/reference/stable/story-syntax.html.
Another solution might be to have a step "When n records are created". The implementation of this step just calls the code of the steps needed for the creation of a record n times.

Related

Repast: Agent execution order

I have an agent called truck, which will perform some actions (e.g. loading packages).
The problem here is related to the random sequence of agents executing actions. For instance, suppose I have three trucks, the loading sequence is random at each different run.
Run-1: truck-1, truck-3, truck-2
Run-2: truck-2, truck-1, truck-3
Run-3: truck-3, truck-1, truck-2
...
How to make sure the agent(truck) executing actions based on a sequence, e.g. by their id so that we can always get the consistant result from the simulation.
Run-1: truck-1, truck-2, truck-3
Run-2: truck-1, truck-2, truck-3
Run-3: truck-1, truck-2, truck-3
...
There's at least 3 ways to do this.
If you set the random seed, the order of the trucks should be the same across runs, all other things being equal. It most likely won't be ordered by id, but it should be the same.
Add all the trucks to an ArrayList when they are created. Sort this list by id and each tick of the simulation iterate through this list, executing the truck action on each truck. A quick google should show you how to order a Java List using a Comparator.
Adapt the scheduling to reflect truck id - for example, truck 1 executes at 1.0 and every tick thereafter, truck 2 at 1.1 and every tick thereafter, truck 3 at 1.2, and so on.
A kind of variation on 3. Set the scheduling priority by id -- all the trucks could execute at 1.0 and every tick thereafter, but with truck 1 having the highest priority, truck 2 the next, and so on.
As a side note, the random iteration of the items in a schedule is the default to prevent common ABM behavior execution ordering issues, such as first mover advantage.

Azure Dev-Ops Query based suite adds items 3 times

I am creating Test Plans using Query Based Suites and am getting multiple items.
Create a Query based suite with very simple rules -> Run Query
Let's say 6 items are returned. I select all 6 and click "Create Suite"
The Suite that is created has 18 items (each of the 6 items is copied 3 times)
Any ideas how I can get this to stop?
No no no, the issue is it adds it to a different configurations:
So in order to see 1 test instead of 3 you need to click right mouse button on the configuration and un-assign all configs that you don't need.
Where to adjust default settings I don't know :(

Combine the Output of 3 Transformation in Pentaho

I'm executing 3 transformations in parallel. the o/p of three transformation contains same column names.
I've added output of all transformation to common dummy step in job and also added WaitForSql step to wait until all 3 transformations have completed execution, and also added unique step in next transformation to remove duplicate records.
All works proper till WaitForSQL, but when next transformation gets rows from result and performs Unique step I get duplicate records also when I perform Unique step.
Has anyone solution for this issue, plz reply.....
You have to sort your resulting stream after the dummy step before removing the duplicate rows. The sort will also make sure that all 3 streams are completed before sorting.
I didn't know you could use the dummy step to combine stream results. I always used the append streams-step for that.
Several points:
You cannot simply combine the outputs of multiple transformations at the job level. You wil need another transformation to read the data using the Get rows from result; jobs don't know about data streams, they only know about tasks (job entries) and exit status.
Be careful with "Launch next entries in parallel" at the job level. Lets say you have 2 transformations, trans1 and trans2, launched in parallel, followed by a dummy step. The dummy will be called TWICE, once after trans1 finishes and another when trans2 finishes. A job hop is not a data stream, it's a workflow. If you want to run transformations in parallel and later go back to a single workflow you need a subjob that calls the transformations and doens't have a Success job entry. That way, the subjob only finishes after the 2nd transformation finishes and only then it goes to the dummy step in the parent.
Why do you need those transformations running inside a job? If they have the same column structure, why don't you call them as sub transformations inside a transformation, and not a job? Steps in a transformation are always launched in parallel, so if you're parallelizing things for performance, a transformation is the way to do it, not a job. A job is meant to run multiple tasks in sequential order, one after the other, with workflow control depending on the result of the previous step.
If you want the Output from three of them into a single file, then you could run the same 3 instances in a single transformation with the append to target option ticked in your output step

Running multiple Thread Groups sequentially in JMeter

I have a Test plan in which there are multiple Thread Groups.
I want to run all of the Thread Groups sequentially.
Thread Groups are as below:
Thread Group1
Thread Group2
Thread Group3
. . .
Thread GroupN
I've read in different blogs and articles on the internet, people claiming that the thread groups will run in the order they are defined but apparently they are not in my case. Thread Group4 runs before Thread Group1. Thread Group4 is generating a report which is wrong because it runs before Thread Group1.
How do I ensure the ordering of my Thread Groups?
Also, I need to implement the following scenarios:
Run a single request multiple time by a single user (Single user should create 1000 accounts from a single HTTP request).
Run a multiple requests multiple times by multiple users simultaneously (Multiple users should create 1000 accounts simultaneously from a single HTTP request).
How to do so?
PS: Please read and understand the query carefully before replying.
Concerning consecutive execution of thread groups in test plan: simple check Run Test Group consecutively check-box on the Test Plan configuration screen:
Use e.g. Loop Controller for this:
Thread Group
Number of Threads = 1
Loop Count = 1
...
Loop Controller
Loop Count = N
HTTP Request
...
or even schema without Loop Controller but not so flexible:
Thread Group
Number of Threads = 1
Loop Count = N
...
HTTP Request
...
Use Number of Threads property of standard Thread Group for this together with Ramp-Up Period property:
Thread Group
Number of Threads = N
Ramp-Up Period = 0
Loop Count = 1
...
HTTP Request
...
This will start N simultaneous threads executing same scenario.
Check the Run Thread Groups consecutively (i.e. run groups one at a time) in the Test Plan.
Refer this link. This asks you to check the check box in the main Test Plan
Run Thread Groups consecutively (i.e. one at a time)
http://www.mahsumakbas.net/run-jmeter-thread-groups-consecutively/
Just add more thread groups in your test plan.
In test plan properties -> tick Run Test Group consecutively for step by step execution of thread groups.
Here is the simple solution which I found for Running multiple Thread Groups in particular order:
Check the option "Run Thread Groups consecutively" under "Test Plan"
Order your "Thread Group/s" in the order you want to be executed using drag and drop approach
Regarding Alies Belik answer, there is another way than running thread group consecutively
which is to use Setup Thread Group for the first part.
Regarding setting ramp-up period, it is better to set a value > 0,
which is more realistic one as depending on the number of threads
to start it could delay there startup, the more you have the more it takes time to start.

running two scenario at same time with loadrunner

Can we run two scenarios at same time with loadrunner?
E.g. Suppose there are 50 user and I have to generate script such that 25 user accessing login and order modules and other 25 user just browsing the site.
Is it possible to generate such scenario?
Running multiple scenarios at the same time (assuming standalone controller) is not possible on THE SAME controller at THE SAME time.
From your description of the problem I assume you are looking for multiple scripts (groups) running in the same scenario - if so then the answer is YES.
In the controller you add more Groups (scripts are called groups in controller) and define the number of vusers or % of total vusers (depending on scenario type & controller version) for the group. I have not seen any limit on the number of groups/scenario. I've never needed more than 15 groups in a single scenario thou ..
Rohit,
I have a direct question for you, are you using an evaluation license?
Generally you would just use a 50 user license with two groups of 25 users apiece. The only time I get this question for the past 15 years is when someone is trying to combine result sets for two 25 user evaluation license copies of a LoadRunner controller.
Rohit, you can create two seperate scripts - one for your login & other for browse site transactions. In controller scenario , you can select select by Group and add these two scripts in your groups and assign 25 vusers each to both.