import unittest from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager options = Options() options.add_argument("start-maximized") driver = webdriver.Chrome(service=Service(ChromeDriverManager().install())) class PythonOrgSearch(unittest.TestCase): def test_visit(self): driver.get("https://www.google.com") driver.find_element_by_xpath('/html/body/div[1]/div[3]/form/div[1]/div[1]/div[1]/div/div[2]/input').send_keys('softans.com') def test_login(self): driver.find_elements_by_xpath('/html/body/div[1]/div[3]/form/div[1]/div[1]/div[3]/center/input[1]').click() if __name__ == "__main__": unittest.main()
AttributeError: ‘list’ object has no attribute ‘click’
Share
really?