Below is the code for Configration reader Utility in Python
from configparser import ConfigParser
def readConfig(section, key):
config = ConfigParser()
config.read(".\\conf.ini")
return config.get(section, key)
# print(readConfig("locators","Login_btn_URL_XPATH"))
and the configuration reader file is like this:
[base URL]
api_base_url=https://google.com
[Json Request Body Path]
# All API Request Body present here
API_Request_Body_PATH=C:\\Request_body\\API
Comments
Post a Comment