In selenium, when should we declare a method or variable as static or non-static..
Any criteria for that in our framework or program ?
InstructorSupport Team Reply on 03/02/2020
Please refer to module 3. We have covered in detail the difference and use of this concept.
In simple words,
static: can be accessed directly with class name
non-static: can only be accessed with the help of an object.
I know the difference in this and how to declare..
But my Q is when should be go for static and when to declare Non static ? Any criteria or something for this ?
InstructorSupport Team Reply on 04/02/2020
Static will return the same data everywhere whenever accessed.
NonStatic will return different data for different objects.
I would suggest you to go through the videos once and then try the concept manually to fully understand the difference.