Skip to content Skip to sidebar Skip to footer

Python Selenium Test Does Not Run When Using Absolute Path To Firefox Geckodriver

I am trying to run Selenium test in Python on Linux Ubuntu environment. Geckodriver is located in my project root folder. I run the file named siteTest.py from PyCharm command line

Solution 1:

Your program was near perfect. You just need to annotate the siteTestclass as unittest.TestCase. So effectively, you need to rewrite the line:

classsiteTest:

as:

class siteTest(unittest.TestCase):

Solution 2:

You probably need to annotate your set up and tear down methods.

@classmethod
 def setUp(self)
  .
  .

@classmethod
 def tearDown(self)
  .
  .

Here, I have annotated as class method so it will run only once for the class.

Post a Comment for "Python Selenium Test Does Not Run When Using Absolute Path To Firefox Geckodriver"