title: PowerShell Selenium Code to Wait Until Element Attribute Has a Specific Value
body: <p>In PowerShell Code, I need to wait until an attribute of a web element changes its value. I am writing an automated test using PowerShell and Selenium WebDriver. When I press the Play button of the video player. the aria-valuenow attribute of the VideoLoaded div changes its value from 0 to something else. I need the WebDriver to wait until the value of aria-valuenow attribute of the div is not equal to 0. </p>
  
  <p>The following is an example of the same code written in C# but I don't know how to write it in PowerShell.</p>
  
  <pre><code>waitForElement.Until((Driver) =&gt; Driver.FindElement(By.CssSelector("div[class='loaded']")).GetAttribute("aria-valuenow") != "0");
  </code></pre>
  
  <p>I have written the following powershell selenium webdriver code to wait using the expected conditions element to be clickable but can't figure out a way to accomplish the wait for attribute value to change. Please help. Thanks </p>
  
  <pre><code>$seleniumWait.Until([OpenQA.Selenium.Support.UI.ExpectedConditions]::ElementToBeClickable([OpenQA.Selenium.By]::XPath("//span[text()='Recognise the importance of air']")));
  </code></pre>