In java we have .property file to have all our locators, how to have and use a same kind of file in python?
-
3Why you need to store locators separate from page object , that would be a really hectic task to maintain– PDHideCommented Feb 27, 2020 at 12:31
-
I think it will be useful if we wanted to use the same locators multiple times,it will be easy to change or modify the locators if any modifications done to it.We can have creds too in it.– MohanCommented Feb 27, 2020 at 13:10
-
1The main use of POM model is to avoid dependency, this approach is creating dependency and if there is a situation when an entire page is refactored, you could be finding it hard to refactor all the other dependencies. IF locators which are reused belong to same lement say , header or footer in all pages. Then its better have that as different page object like headerFrame.bla– PDHideCommented Feb 27, 2020 at 13:15
Add a comment
|
1 Answer
I think you can use the ConfigParser if you want to store testdata in files
This module provides the ConfigParser class which implements a basic configuration language which provides a structure similar to what’s found in Microsoft Windows INI files. You can use this to write Python programs which can be customized by end users easily.