Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into dev
  • Loading branch information
Cotel committed Nov 12, 2017
2 parents 83441f9 + 34c7b43 commit 2722ffb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/kotlin/usecases/ElCorteInglesSearchProduct.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ class ElCorteInglesSearchProduct: ISearchProducts() {
}

private fun selectBrand(brand: String) {
val brandsList = webDriver.findElements(By.className("facet-popup"))
val filteredBrandsList = brandsList.filter { it.getAttribute("title").toLowerCase() == brand.toLowerCase() }
val brandsList = webDriver.findElements(By.className("dimensions"))
val brandListFiltered = brandsList.map {
it.findElement(By.className("facet-popup"))
}
val filteredBrandsList = brandListFiltered.filter { it.getAttribute("title").toLowerCase() == brand.toLowerCase() }

if (filteredBrandsList.isNotEmpty()) {
filteredBrandsList.first().click()
Expand Down

0 comments on commit 2722ffb

Please sign in to comment.