It is pretty much possible that the line with WebElement.getText()
would work but the line with WebElement.click()
won't work as follows :
driver.findElement(By.xpath("//div[@class='filter-title' and text()='Бренд']")).getText() //works
driver.findElement(By.xpath("//div[@class='filter-title' and text()='Бренд']")).click() //doesn't work.
Explaination
The reason for this behavior is when the Client (i.e. the Web Browser) returns back the control to the WebDriver instance once 'document.readyState' equals to "complete" is achieved, it is quite possible that the intended WebElement is present (element is present but does not necessarily mean that the element is interactable) and visible i.e. (element is visible and also has a height and width that is greater than 0). So you were able to extract the text Бренд.
But the WebElement being present and visible but doesn't garuntees that the WebElement is also clickable i.e. interactable.
Here you can find a detailed discussion on 'document.readyState' equal to "complete"
Solution
To click on the WebElement with text as Бренд you have to induce WebDriverWait as follows :
new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//div[@class='filter-title' and text()='Бренд']"))).click();