I need to find an element which changes each time the page is loaded.
The prefix “ABC_ID” and suffix “login” remains the same.
I’ve tried xpath with “contains” and “starts-with” / “substring”, but no success.
return $browser.waitForAndFindElement(By.xpath("//[contains(@id,‘login’)]"), DefaultTimeout).then(function(el) {
return $browser.waitForAndFindElement(By.xpath("//*[starts-with(@id, ‘ABC_ID’) and substring(@id, string-length(@id) - string-length(‘login’) +1) = ‘login’]")).then(function (el) {
Any idea of what is wrong?