Showing uo below error message after running the pytest code.
Traceback (most recent call last):
AttributeError: module 'pytest' has no attribute 'main'
Python version: 3.7.4
Pytest Version: 5.4.1
driver=webdriver.Chrome(executable_path=path) #from where need to execute the path #
driver.implicitly_wait(10) # It will wait till the browser and the url is loaded. Take the time is sec#
time.sleep(3) #import time package to check the browser is completely opened#
InstructorSejal Reply on 02/04/2020
Please make sure you make the following checks:
1. The test runner is py.test while running the test.
2. The location of the driver is properly given.
3. The package name and module name starts with test.
4. While creating package there is a file named '__init__.py' is not modified and is lying in the same package.
5. Run the test case as Python Unit-test
Still if the issue is coming for main, delete the package and recreate it
I am getting error even though I dont have any of above conditions. when I add new key word it starts to dispaly error. Also Test case stops, and no report is generated. There is some other reasons?
InstructorSejal Reply on 19/05/2020
The error who are facing can be result of different version of pytest. Please try using older version of pytest by unistalling it from cm using the command "pip uninstall pytest" and installing the older version again and try running the code.