0

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

asked Feb 27, 2020 at 12:17
3
  • 3
    Why you need to store locators separate from page object , that would be a really hectic task to maintain Commented 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. Commented Feb 27, 2020 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 Commented Feb 27, 2020 at 13:15

1 Answer 1

1

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.

https://docs.python.org/3/library/configparser.html

answered Feb 27, 2020 at 12:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.