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:
python3 siteTest.py
However, I do not see any output from Selenium. The test worked before I divided it into setUp, test and tearDown and added self as a parameter. Any suggestions what I am doing wrong? Thanks in advance.
import os
import unittest
from selenium import webdriver
class siteTest:
def setUp(self):
ROOT_DIR = os.path.abspath(os.curdir)
self.driver = webdriver.Firefox(executable_path=ROOT_DIR + '/geckodriver')
def test(self):
driver = self.driver
driver.get('https://google.com/')
def tearDown(self):
self.driver.quit()
if __name__ == "__main__":
unittest.main()