Skip to content

Commit

Permalink
Added comment about implementation defined-ness.
Browse files Browse the repository at this point in the history
  • Loading branch information
grokys committed May 2, 2024
1 parent fcface8 commit 26b0732
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/FlaUI.WebDriver/Controllers/ElementController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ public async Task<ActionResult> GetElementText([FromRoute] string sessionId, [Fr

private static string GetElementText(AutomationElement element)
{
// https://www.w3.org/TR/webdriver2/#get-element-text says about this:
//
// > Let rendered text be the result of performing implementation-specific steps whose result is exactly
// > the same as the result of a Function.[[Call]](null, element) with bot.dom.getVisibleText as the this value.
//
// Because it's implementation-defined, this method tries to follow WinAppDriver's implementation as closely as
// possible.
if (element.Patterns.Text.IsSupported)
{
return element.Patterns.Text.Pattern.DocumentRange.GetText(int.MaxValue);
Expand Down

0 comments on commit 26b0732

Please sign in to comment.