Selenium WebDriver Error: AttributeError: 'list' object has no attribute 'click'

0 votes

I want to use the click command on my test page. But I'm getting the below error. I've written it in python. 

Traceback (most recent call last):
File "C:\Users\admin\workspace\LDC\test.py", line 13, in <module>
driver.find_elements_by_link_text("MISCQA Misc Tests").click()
AttributeError: 'list' object has no attribute 'click'

And below is my code. Please help.

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By 
from selenium.common.exceptions import NoSuchElementException 
from selenium.webdriver.support.ui import WebDriverWait
import config

url = config.config.get('url')

driver = webdriver.Ie()
driver.get(url)

driver.find_elements_by_link_text("MISCQA Misc Tests").click()

driver.close()
Jun 8, 2018 in Selenium by eLiJha
• 720 points
2,904 views

1 answer to this question.

0 votes
The error is because your using driver.find_elements instead of driver.find_element. That's a syntactical mistake. Let me know if it solves it.
answered Jun 8, 2018 by king_kenny
• 3,650 points
Thank you so much )))
Hope you found it useful @Sergey_QA :)
Your example helped me a lot))
Glad that you got an answer.

Related Questions In Selenium

0 votes
1 answer

'The connection has timed out Error using Selenium Webdriver

Try to use implicit waits to ensure ...READ MORE

answered Apr 17, 2018 in Selenium by niki
1,081 views
0 votes
1 answer
0 votes
1 answer

Double click a record in a grid using Selenium webdriver

Try Actions class to perform this Actions action ...READ MORE

answered Mar 29, 2018 in Selenium by Damon Salvatore
• 5,510 points
984 views
0 votes
1 answer
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
555 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
890 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
553 views
0 votes
1 answer

How do i click on <input type=file> on any browser if i'm testing with Selenium Webdriver?

Does not matter which OS or which ...READ MORE

answered Apr 29, 2018 in Selenium by king_kenny
• 3,650 points
2,983 views
0 votes
1 answer

Need some advise on the preferred element locators with Selenium WebDriver

Well let's not call it "Hierarchy". But, ...READ MORE

answered Apr 13, 2018 in Selenium by king_kenny
• 3,650 points
91 views