how to pass Excel file name via command line to pytest

19 Views Asked by At

I am running my automation scripts on 2 portals(STAGE AJS, STAGE IAM). So I have stored those portal URL and credentials in a .xlsx file and I am using the .env file where I am reading the filepath.

**.env file**
#Stage environment
filepath = "ExcelFiles/StageAJSDataSource.xlsx"
#filepath = "ExcelFiles/StageIAMDataSource.xlsx"

Everytime when I run the pytest, I have to manually uncomment the filepath in the .env file to choose the excel file. can I pass this filepath in command line and run only on particular portal? Please suggest me.

0

There are 0 best solutions below