Is it possible to locate element by partial id match in Selenium

0
0

I am trying to locate elements with generated ids wherein some part of the ID is known; for example:

id="page_x002e_x0023_default-create-firstname"

in which the last 3 words (_default-create-firstname) are known but anything preceding that is subject to change.
Is this possible?

  • You must to post comments
0
0

You can apply an ends-with CSS selector:

By.cssSelector("[id$=default-create-firstname]")
  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website