AttributeError: 'WebDriver' object has no attribute 'find_elements_by_xpath'

i got an error while trying to run a robot framework script. Can some one help me to solve the issue. Basically xpath is not working with robot framework.

You need to know how to ask questions to be helped.
At least show the XPATH you have and if possible a public URL and the HTML code you want to select.
If you paste here, with proper code styling, a minimal example of Robot Framework test file, you will have help really quick.
(the time I have spent in writing this, could have been spent in writing the solution for your problem)

1 Like

Thanks for suggestion.


I am trying to write and execute a script for google search input box. I have given xpath as per attached screenshot but got an error unfortunately didn’t find any solution.

Without looking at the documentation of SeleniumLibrary, I suspect the problem is you using xpath:and not xpath=.

xpath= is also given the same error

find_elements_by_xpath has been deprecated and removed from selenium long time ago and from seleniumlibrary those where removed few years ago completely. From this point only, issue feels that you have Old version of SeleniumLibrary installed and newer selenium that do not work together. I’d suggest to re-install your python environment into virtualenv and then verify that all dependencies are correct.

1 Like

Updated selenium Library, it works now
Thank you

hello , I have the same error “AttributeError: ‘WebDriver’ object has no attribute ‘find_elements_by_xpath’”
I use python 8.5 / robot framework 3.2.1 / seleniumlibrary = 3.2.0

@emma I would say that with that “old” setup, you would need to use an old version of the browser and its corresponding webdriver. We can assume that the new webdriver does not have that function/method, find_elements_by_xpath but SeleniumLibrary/Selenium is still calling it.

Of course the best solution is to upgrade the tools and libraries.

1 Like

Can you please share your dependencies list.
Python- 3.6
Can you please suggest, what’ wrong?
My dependencies list :
image

Keyword- wait until keyword succeeds 30 5s SeleniumLibrary.Page Should Contain ALL CHATS

Do you @snehal get the exact same error in the title of this thread?

If not, then It is called thread hijacking , using an existing topic to talk about a different one/question.

1 Like