0

This is the error I am getting below:

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="select-input-a7c294b6-e242-44b4-b153-67f6f42ecf77-opt-0"]"}

I am adding sleep(10) testing to see if the page isn't loading but this isn't the case.

This is what I am using:

self.driver_web.find_element_by_xpath('//*[@id="select-input-a7c294b6-e242-44b4-b153-67f6f42ecf77-opt-0"]').click()

enter image description here

  • Does this locator works in browser inspect. On doing what this element appears ? – PDHide Dec 10 '19 at 20:42
  • Did you try explicit wait ? For element to be there present – PDHide Dec 10 '19 at 20:44
  • @pdHide I haven't tried using explicit wait i will try now. I found this xpath using the browsers inspect and also using "xpath finder" extension – QAtester-Light Dec 10 '19 at 20:58
  • 1
    @pdhide hey i got it to work! – QAtester-Light Dec 10 '19 at 23:31
  • 1
    please add the answer – PDHide Dec 11 '19 at 7:42
0

Class and ID are auto-generating so I think that you should change xpath to contain (text(),'text of element') or anything that was fixed.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.