title: Microsoft UI Automation for Web Application
body: <p>Has anyone tried "Microsoft UI Automation" for web application?</p>
  
  <p>I have a WPF application which has a embedded wpfbrowser.
  Since this is basically a desktop app, I cant use Selenium Webdriver.</p>
  
  <p>I tried CodedUI but i am facing a issue, Which i have asked here:
  <a href="https://stackoverflow.com/questions/40872791/coded-ui-unable-to-identify-a-html-controls-on-a-wpfbrowser">Coded UI - Unable to identify a html controls on a Wpfbrowser</a></p>
  
  <p>I am planning to use UIAutomation, But again itseems that i am unable to identify a control using id property</p>
  
  <p>Ex:</p>
  
  <pre><code>&lt;button id="but1"&gt;Click Me&lt;/button&gt;
  </code></pre>
  
  <p>For this i have:</p>
  
  <pre><code>PropertyCondition ps = new PropertyCondition(AutomationElement.AutomationIdProperty, "but1");
  AutomationElement Clickme = elementMainWindow.FindFirst(TreeScope.Descendants, ps);
  </code></pre>
  
  <p>But this is not working. "Clickme" is null.</p>
  
  <p>How to do this is UIAutomation??</p>
  
  <p>EDIT: Attaching a screeshot:
  <a href="https://i.stack.imgur.com/UC960.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UC960.png" alt="enter image description here"></a></p>