KEYCLOAK-2913 Switch to use xpath for finding links instead of adding an

id.
This commit is contained in:
Stan Silvert 2016-05-23 09:19:18 -04:00
parent 049b0dda23
commit 8d56ab90ba
4 changed files with 4 additions and 4 deletions

View file

@ -46,7 +46,7 @@ public abstract class AbstractAccountPage extends AbstractPage {
}
public void openLanguage(String language){
WebElement langLink = localeDropdown.findElement(By.id("kc-locale-" + language));
WebElement langLink = localeDropdown.findElement(By.xpath("//a[text()='" +language +"']"));
String url = langLink.getAttribute("href");
driver.navigate().to(url);
}

View file

@ -184,7 +184,7 @@ public class LoginPage extends AbstractPage {
}
public void openLanguage(String language){
WebElement langLink = localeDropdown.findElement(By.id("kc-locale-" + language));
WebElement langLink = localeDropdown.findElement(By.xpath("//a[text()='" +language +"']"));
String url = langLink.getAttribute("href");
driver.navigate().to(url);
}

View file

@ -37,7 +37,7 @@
<a href="#" id="kc-current-locale-link">${locale.current}</a>
<ul>
<#list locale.supported as l>
<li class="kc-dropdown-item"><a href="${l.url}" id="kc-locale-${l.label}">${l.label}</a></li>
<li class="kc-dropdown-item"><a href="${l.url}">${l.label}</a></li>
</#list>
</ul>
</div>

View file

@ -48,7 +48,7 @@
<a href="#" id="kc-current-locale-link">${locale.current}</a>
<ul>
<#list locale.supported as l>
<li class="kc-dropdown-item"><a href="${l.url}" id="kc-locale-${l.label}">${l.label}</a></li>
<li class="kc-dropdown-item"><a href="${l.url}">${l.label}</a></li>
</#list>
</ul>
</div>