-1

I need to match //*[@id="ember140"] xpath for selenium. Can someone provide me any solution as how to match any regular expression that starts with @id="ember*****" that is anything followed by ember.

I tried

checker = driver.find_element_by_xpath("//*[starts-with(@id, 'ember')")

It didn't work.

KunduK
  • 32,888
  • 5
  • 17
  • 41
  • //*[contains(@id, "ember")] will match anything that's contains (not just starts) – RichEdwards Jul 27 '20 at 16:34
  • 1
    When you say "it didn't work" especially after trying the advice of people who spend time helping you please put some effort to explain what exactly you mean when say "didn't work". Either it finds element that you do not expect or it finds no elements. – Alexey R. Jul 27 '20 at 20:10
  • Does [this](https://stackoverflow.com/questions/12933422/ember-best-practices-with-selenium-to-make-integration-tests-in-browser/60547527#60547527), [this](https://stackoverflow.com/questions/59276695/selenium-finding-element-based-on-ember/59282757#59282757), [this](https://stackoverflow.com/questions/45653659/ember-dropdown-selenium-xpath/60548670#60548670) or [this](https://stackoverflow.com/questions/37026817/automate-ember-js-application-using-selenium-when-object-properties-are-changed/60546822#60546822) discussion help you? – undetected Selenium Jul 27 '20 at 21:45

1 Answers1

1

Your Xpath seems wrong.Try this

checker = driver.find_element_by_xpath("//*[starts-with(@id, 'ember')]")
KunduK
  • 32,888
  • 5
  • 17
  • 41