Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created May 25, 2017 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/a7757f39ec31aecadff2e52f1b007868 to your computer and use it in GitHub Desktop.
Save bjoerntx/a7757f39ec31aecadff2e52f1b007868 to your computer and use it in GitHub Desktop.
private AutomationElement GetTextElement(AutomationElement targetApp)
{
PropertyCondition cond =
new PropertyCondition(
AutomationElement.IsTextPatternAvailableProperty,
true);
AutomationElement targetTextElement =
targetApp.FindFirst(TreeScope.Descendants, cond);
return targetTextElement;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment