Following code is workingwith Chrome , but NOT in Firefox, it goes to else condition , which means look browser == NULL
print("CLOSING BROWSER :")
print("BROWSER IS CLOSED :")
#print("CAN NOT CLOSE BROWSER :")
InstructorJaspreet Replied on 11/06/2020
May you please share your project so that the issue can be checked.
Its Model 24 Part 15. I think code is very simple, and is working for CHROME , so no need to share project, for small thing
InstructorJaspreet Replied on 16/07/2020
It is a possibility that the driver is not being passed to the fixture where you are calling the Quit function, kindly please check if the driver is being passed. If it is not then you have to create a object of the keywords class in fixture and using the object you have to call the quit function.
def base_fixture(): with allure.step("Initializing Properties File...."): try: propertiesFile = open("D:\\eclipse\\DataDrivenFramework\\config.properties") prop.load(propertiesFile) #creating object of genKeywords class whre Quit function is defined gen = genkeywords() except FileNotFoundError as f: print(f) yield locals() with allure.step("Quitting as Tear Down Process...."): #using the same object to call the quit function gen.Quit()
Kindly please try to make this kind of structure and then try running your code.