Python + WebDriver — No browser launched while using unittest module

后端 未结 3 2153
孤街浪徒
孤街浪徒 2021-01-24 20:51

Could you please help me with the next. I found out the issue and could not resolve it. When I am using next code, the browser has started and the test has passed:



        
3条回答
  •  情深已故
    2021-01-24 21:40

    In unittest, you have to put the tested code in method called

    test_
    

    Moreover I believe you wanted to quit the driver and not unittest? Try to replace the line

    unittest.quit()
    

    With

    self.driver.close()
    

提交回复
热议问题