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
• 700 points
1,692 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,590 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
567 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,250 points
587 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,030 points
60 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
432 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
49 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,590 points
2,052 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,590 points
58 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.