In java we have .property file to have all our locators, how to have and use a same kind of file in python?

  • 3
    Why you need to store locators separate from page object , that would be a really hectic task to maintain
    – PDHide
    Feb 27 '20 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.
    – Mohan
    Feb 27 '20 at 13:10
  • 1
    The 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
    – PDHide
    Feb 27 '20 at 13:15

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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.