Working with Selenium I need to find an element. Contrary to what is recommended, I want to find that element based on what the user sees. I know that this is difficult to solve in the general case, but at least I want to be able to go for elements based on what text/label they carry.
In my case I have an <input type=submit value=text_I_see>
, but it might also be a <button>
, a normal link or even a not so normal link (e.g. JavaScript onclick-thingy) etc.
The browser’s Ctrl-F “Find in page...” search box finds what I want. It highlights it perfectly. And I want to click exactly that! How do I do this?
I do not want to find it using:
- id
- class
- element/tag name
- element specifics
- information only seen in the HTML source
Is this standard use case not supported at all?