How to explicitly wait for the text in an element to be changed in selenium
<p>I am automating an web portal. I came across one different problem. I have two dropdown lists say A and B. When the page loads, A will have first value from list, accordingly B has it's value. When user selects value from A, correspondingly value in B changes. So, I stuck at how could I add explicit wait for this. I tried the following code.</p>

<pre><code>WebDriverWait wait = new WebDriverWait(getDriver(), 20);
        WebElement element = wait.until(ExpectedConditions.presenceOfElementLocated(elementPath));
</code></pre>

<p>but the values in dropdownlist B are already present in the page load. So, it is not waiting for the text in B changes, it is taking the default value.</p>

<p>Can anyone help?</p>