Skip to main content
Added Xpath Details
Source Link

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

#xpaths
cpDvForm = "//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()']"
#code
options= 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 !

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

options= 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 !

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

#xpaths
cpDvForm = "//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()']"
#code
options= 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 !

deleted 25 characters in body
Source Link

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

options= 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.e after d.get(url)). 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 !

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

options= 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.e after d.get(url)). 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 !

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

options= 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 !

Source Link

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

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

options= 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.e after d.get(url)). 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 !