WebDriverException: 'css selector' is not valid or implemented searching strategy error in automation of windows application using Winium

618 views Asked by At

I'm new to the winium and trying to automate the process. every time i run the code im getting an error:

WebDriverException: 'css selector' is not valid or implemented searching strategy.

Below is my code:-

from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC

# starting the file 
os.startfile(r'C:\Users\RTamb\Desktop\python basics\web scraping\winium\Winium.Desktop.Driver\Winium.Desktop.Driver.exe')

driver = webdriver.Remote(command_executor='http://localhost:9999',
desired_capabilities={"debugConnectToRunningApp": 'false',
'app': r'C:\Users\RTamb\Desktop\BO\All Cases (V1.0 New Final Build)_New.rep',
'args': '-port 345'})


driver.find_element_by_id('Edit').click()

I have tried tried multiple method like .find_element_by_name(), find_element_by_class_name, find_element_by_css_selector()

1

There are 1 answers

0
undetected Selenium On

This error message...

WebDriverException: 'css selector' is not valid or implemented searching strategy.

...implies that the searching strategy you have used is not a valid locator strategy

With the availability of find_element_by_* commands are deprecated.

Accordlingly, instead of:

driver.find_element_by_id('Edit').click()

You have to:

driver.find_element(By.ID, "Edit").click()