-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Description:
TESTAR currently relies on the Ctrl + A key combination to select all the text in the System Under Test (SUT) when the user intends to replace the existing text. However, this combination is not always supported as expected for some specific SUT and OS languages or non-Windows OS:
-
On a Windows system with Spanish language settings and using Notepad as the SUT, pressing Ctrl + A tries to save the text as a file instead of selecting all.
-
MacOS does not use Ctrl as a key, leading to inconsistencies in the key combination behavior.
Involved classes:
TESTAR_dev/core/src/org/testar/monkey/alayer/actions/StdActionCompiler.java
Lines 280 to 285 in e978aed
| public Action clickAndReplaceText(final Position position, final String text){ | |
| Assert.notNull(position, text); | |
| // clicking the widget to select it: | |
| CompoundAction.Builder builder = new CompoundAction.Builder().add(leftClickAt(position), 1); | |
| // pressing Cntr + A keys to select all text: | |
| builder.add(new KeyDown(KBKeys.VK_CONTROL), 0.1).add(new KeyDown(KBKeys.VK_A), 0.1).add(new KeyUp(KBKeys.VK_A), 0.1).add(new KeyUp(KBKeys.VK_CONTROL), 0.1); |
TESTAR_dev/core/src/org/testar/monkey/alayer/actions/StdActionCompiler.java
Lines 340 to 345 in e978aed
| public Action pasteAndReplaceText(final Position position, final String text){ | |
| Assert.notNull(position, text); | |
| // clicking the widget to select it: | |
| CompoundAction.Builder builder = new CompoundAction.Builder().add(leftClickAt(position), 1); | |
| // pressing Cntr + A keys to select all text: | |
| builder.add(new KeyDown(KBKeys.VK_CONTROL), 0.1).add(new KeyDown(KBKeys.VK_A), 0.1).add(new KeyUp(KBKeys.VK_A), 0.1).add(new KeyUp(KBKeys.VK_CONTROL), 0.1); |
Posible solution:
Implement a setting ConfigTag or customizable method protocol that enables users to customize the key combination or choose alternative methods for the text selection and replacement action, considering variations in keyboard shortcuts for different operating systems and language settings.