mirror of
https://github.com/TrentSPalmer/hugo_themes_report.git
synced 2025-11-21 02:08:25 -08:00
fix deprecated find_elements_by* and find_element_by*
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
from unittest import TestCase
|
||||
from pathlib import Path
|
||||
from unittest import TestCase
|
||||
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.chrome.service import Service
|
||||
from selenium.webdriver.chrome.options import Options
|
||||
from selenium.webdriver.chrome.service import Service
|
||||
from selenium.webdriver.common.by import By
|
||||
|
||||
OPTIONS = Options()
|
||||
OPTIONS.add_argument('--ignore-certificate-errors')
|
||||
OPTIONS.add_argument('--incognito')
|
||||
@@ -25,5 +28,5 @@ class TestSelenium(TestCase):
|
||||
class TestIDsForDuplicates(TestSelenium, TestCase):
|
||||
def test_for_unique_ids(self):
|
||||
ids = [x.get_attribute(
|
||||
'id') for x in self.driver.find_elements_by_xpath('//*[@id]')]
|
||||
'id') for x in self.driver.find_elements(By.XPATH, '//*[@id]')]
|
||||
self.assertEqual(len(ids), len(set(ids)))
|
||||
|
||||
Reference in New Issue
Block a user