0

I am using protractor-cucumber framework(protractor 5.2.2 and cucumber 3.2.0).

I have a requirements like this - posting some details(from DB) to an application with different user credentials.

Currently, I am doing with a single login credential. So, in beforeLaunch() I have to call one function (which create temporary table that is having all data to be entered for that user), it will split the data for each set(let it be Set 1, Set 2 and Set 3). And I am running the automation script in a 3 nodes by selenium grid by passing this set of numbers to the query (which is used to fetch data from the temporary table according to the set number).

I have a loop in my js file to enter data row by row. And I have set the getMultiCapabilities() dynamically (by dividing total numbers of rows of a table for the given user by a constant number).

I can successfully run it like this. But when I need to run for multiple user, each node may have data for different users. So i need to run in a way that, process one user at a time in all threads and then for next user.

Is it possible to do it like this? Thanks in advance.

Oleksii
  • 1,623
  • 20
  • 26
Devleena
  • 453
  • 9
  • 25

1 Answers1

0

You have a tricky way to run your tests. I'm sure that it could be done in a more "easier to understand" way.

But if does not break your flow, I think you could archive what you want with creating several config files. Where you will keep specific data for each user.

Better to split logic. In test spec files should be nothing specific about user, just something const user = someClass.getUser(). Separately, you should have some class that managed these users. And again, separately, the class where you get and receive and ... data about User X from DB or filesystem or API or whatever.

Oleksii
  • 1,623
  • 20
  • 26