Home > Enterprise >  Unable to locate element ID - NoSuchElementException
Unable to locate element ID - NoSuchElementException

Time:07-17

when im trying to select from a drop-down menu im getting the above error .. the code i'm trying to use :

group = Select(web.find_element(by=By.ID, value='single_select62d3083e1707239'))
group.select_by_visible_text ('COHEEL_IPC-A-620_2207101059')

this is how it looks when I inspect the element

Thanks for the time :)

CodePudding user response:

You can use the xpath to locate the element. Try the following Xpath -

//label[contains(text(),'Separate groups')]/following-sibling::select

The code would look like -

sel = web.find_element_by_xpath("//label[contains(text(),'Separate groups')]/following-sibling::select")
sel.select_by_visible_text('COHEEL_IPC-A-620_2207101059')
  • Related