# AttributeError: 'WebDriver' object has no attribute 'find\_elements\_by\_xpath'

**URL:** <https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805>\
**Category:** Robot Framework\
**Created:** [11 October 2022 16:02 UTC](https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805 "2022-10-11T16:02:44Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![vipuljain215](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/vipuljain215/32/1937_2.png) [@vipuljain215](https://forum.robotframework.org/u/vipuljain215)\
**Post date:** [11 October 2022 16:02 UTC](https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805/1 "2022-10-11T16:02:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![HelioGuilherme66](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/helioguilherme66/32/34_2.png) [@HelioGuilherme66](https://forum.robotframework.org/u/HelioGuilherme66)\
**Post date:** [11 October 2022 21:14 UTC](https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805/2 "2022-10-11T21:14:16Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![vipuljain215](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/vipuljain215/32/1937_2.png) [@vipuljain215](https://forum.robotframework.org/u/vipuljain215)\
**Post date:** [12 October 2022 07:18 UTC](https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805/3 "2022-10-12T07:18:48Z")

</div>

Thanks for suggestion.

---

<div class="post-metadata">

**Author:** ![vipuljain215](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/vipuljain215/32/1937_2.png) [@vipuljain215](https://forum.robotframework.org/u/vipuljain215)\
**Post date:** [12 October 2022 07:22 UTC](https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805/5 "2022-10-12T07:22:13Z")

</div>

![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/8/87bafefac2163a4125f414fffe3e9e976eafb6da.png)  
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.

---

<div class="post-metadata">

**Author:** ![vipuljain215](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/vipuljain215/32/1937_2.png) [@vipuljain215](https://forum.robotframework.org/u/vipuljain215)\
**Post date:** [12 October 2022 07:24 UTC](https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805/6 "2022-10-12T07:24:28Z")

</div>

![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/6/69aa22674692d3fda78222ee31ecddb62a528fba.png)

---

<div class="post-metadata">

**Author:** ![HelioGuilherme66](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/helioguilherme66/32/34_2.png) [@HelioGuilherme66](https://forum.robotframework.org/u/HelioGuilherme66)\
**Post date:** [12 October 2022 08:39 UTC](https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805/7 "2022-10-12T08:39:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vipuljain215](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/vipuljain215/32/1937_2.png) [@vipuljain215](https://forum.robotframework.org/u/vipuljain215)\
**Post date:** [12 October 2022 09:23 UTC](https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805/8 "2022-10-12T09:23:07Z")

</div>

> [@HelioGuilherme66](#):
>
> `xpath=`

`xpath=` is also given the same error

---

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [12 October 2022 09:37 UTC](https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805/9 "2022-10-12T09:37:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vipuljain215](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/vipuljain215/32/1937_2.png) [@vipuljain215](https://forum.robotframework.org/u/vipuljain215)\
**Post date:** [12 October 2022 09:51 UTC](https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805/10 "2022-10-12T09:51:44Z")

</div>

Updated selenium Library, it works now  
Thank you

---

<div class="post-metadata">

**Author:** ![emma](https://avatars.discourse-cdn.com/v4/letter/e/57b2e6/32.png) [@emma](https://forum.robotframework.org/u/emma)\
**Post date:** [7 December 2022 19:12 UTC](https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805/11 "2022-12-07T19:12:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![HelioGuilherme66](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/helioguilherme66/32/34_2.png) [@HelioGuilherme66](https://forum.robotframework.org/u/HelioGuilherme66)\
**Post date:** [9 December 2022 12:02 UTC](https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805/12 "2022-12-09T12:02:02Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![snehal](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@snehal](https://forum.robotframework.org/u/snehal)\
**Post date:** [3 January 2023 10:42 UTC](https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805/13 "2023-01-03T10:42:33Z")

</div>

Can you please share your dependencies list.  
Python- 3.6  
Can you please suggest, what’ wrong?  
My dependencies list :  
 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/4/4878788e2479d1a94d5fc1ae4cdb43c013d00afa.png)

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

---

<div class="post-metadata">

**Author:** ![HelioGuilherme66](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/helioguilherme66/32/34_2.png) [@HelioGuilherme66](https://forum.robotframework.org/u/HelioGuilherme66)\
**Post date:** [3 January 2023 12:21 UTC](https://forum.robotframework.org/t/attributeerror-webdriver-object-has-no-attribute-find-elements-by-xpath/4805/14 "2023-01-03T12:21:27Z")

</div>

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.
