Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Selenium unittest example structure
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException
import os
chromedriver = "D:\\chromedriver.exe"
os.environ[""] = chromedriver
class CS(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome(chromedriver)
def test_samsung_apps_loading(self):
driver = self.driver
self.assertIn("Samsung", driver.title)
def tearDown(self):
if __name__ == "__main__":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.