Python webdriver methods not working on Edge Chromium

677 views
Skip to first unread message

Simon C

unread,
Mar 25, 2020, 3:17:07 AM3/25/20
to Selenium Users

I’m getting an “invalid locator” error from the selenium webdriver when running tests on Edge Chromium.

 I’m using the python webdriver, the browser opens fine and goes to a page, just using google.co.uk to test. 

The test works when using the XPath to find the search bar, but when I try to use the element name ‘q’, the test fails and gives me this:

selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid locator

Edge version: 80.0.361.66
With relevant msedgedriver from https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

selenium version 4.0.0a3


This method works:
.find_element_by_xpath(self.query_field_name)

This method does not work:
.find_element_by_name(‘q’)


The same method works fine when I choose to run on Chrome. Is this a known issue with the new Edge browser?

Thanks.

Anil Gursahani

unread,
Apr 3, 2020, 1:45:58 AM4/3/20
to Selenium Users
Hi Simon,

It could possibly be that the edge driver is taking longer to load the element in the DOM.  Try waiting for the element to become visible and then click on the element.

Anil
Reply all
Reply to author
Forward
0 new messages