Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Getting 'object doesn't support property or method "evaluate"' in selenium | IE

$
0
0

I am automating a web app on IE(Internet Explorer) browser.

I am getting the below error when I am trying to find any element on the page after the page is loaded.

selenium.common.exceptions.InvalidSelectorException: Message: Unable to locate an element with the xpath expression //div[@id='index_logo']/following-sibling::div/form because of the following error:TypeError: Object doesn't support property or method 'evaluate';

The code

#xpathscpDvForm = "//div[@id='index_logo']/following-sibling::div/form"cpDvUser = "//input[@id='username']"cpDvPass = "//input[@id='password']"cpDvLanRadio = "//input[@id='net_lan']"cpDvLogin = "//a[@onclick='login()']"#codeoptions= webdriver.IeOptions()d = webdriver.Ie(options=options)d.get(url)#time.sleep(10)#WebDriverWait(d,10).until(EC.element_to_be_clickable(d.find_element(By.XPATH,cpDvUser)))form = d.find_element(By.XPATH,cpDvForm)form.find_element(By.XPATH,cpDvUser).clear()form.find_element(By.XPATH,cpDvUser).send_keys('user')form.find_element(By.XPATH,cpDvPass).send_keys('pass')form.find_element(By.XPATH,cpDvLanRadio).click()form.find_element(By.XPATH,cpDvLogin).click()

I have tried inducing Webdriver wait and sleep waits too,for ensuring page is loaded.I have checked for Iframes and shadow dom. there is neither.

As mentioned, the error occurs when we try to search for any element after page is loaded.All suggestion and solutions are appreciated!!

Additional note/info :

  • I am required to use IE browser
  • Selenium 4.18.0
  • Python 3.12

Let me know if any more information is required will add accordingly. Cheers !


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>