From 26b07323ded5ebc8886ed99cdbaf86e1c9c5d6df Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 2 May 2024 11:29:06 +0200 Subject: [PATCH] Added comment about implementation defined-ness. --- src/FlaUI.WebDriver/Controllers/ElementController.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/FlaUI.WebDriver/Controllers/ElementController.cs b/src/FlaUI.WebDriver/Controllers/ElementController.cs index 49724d7..9f3faf6 100644 --- a/src/FlaUI.WebDriver/Controllers/ElementController.cs +++ b/src/FlaUI.WebDriver/Controllers/ElementController.cs @@ -93,6 +93,13 @@ public async Task 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);