Is there any way to make user-defined Selenium methods? For instance, in the version of Selenium we use there is no ends-with(). So I have to do something like
//input[substring(@id, string-length(@id) - string-length('_PHONE$1') +1) = '_PHONE$1'] instead of //input[ends-with('_PHONE$1')].
So if I could do something like (and this is just an example):
define my-ends-with(String endsWith) {
substring(@id, string-length(@id) - string-length(endsWith) +1) = endsWith
}
I am using Java and Eclipse and Chrome and Selenium. The selenium version is the one with Chrome that does not have an ends-with().
Chrome == 67.0.3396.87
Java 1.8