I need to develop reusable POM with Page Factory for dependent Scenarios. How I can use minimal time and memory for filling up POM with Page Factory.
General idea:
Scenario1:
Given Do something NUM1
When Do Something NUM2
And Do Something NUM3
Scenario2:
Given Do something NUM4.
When Do Something NUM5.
And Do Something NUM6.
Scenario 3
.....
: Remember all scenarios are dependent. And every sentence is in different step deffinition file(different class).
Assume that StepDefinition for "Do SomethingNUM 3,5, and 6 will use the same POM (visit same page) but they are in different classes.
With conventional model I will call constructor for these three classes and will initialize same POM 3 times (in realality it could be 1000 times). So,I think that there is a way to save some time by creating POM just once for all of these three clases.
On the other hand if I create (store) 5000 element am i dealing with performance or memory issues? (I assume that memory is not the issue,and I am willing to secrefise it so I can save the execution time)
Can I fill the POM just in one class, and then use it in other classes with all the elements inside it. I have some ideas how it might work, but I need someone that already have same issue.