Skip to content

Commit c83ec9b

Browse files
authored
Merge pull request #473 from TESTARtool/development
Remove actionIds from LLM ActionHistory and add aria tags to state model attributes
2 parents 737b8eb + 6ff9994 commit c83ec9b

15 files changed

Lines changed: 103 additions & 42 deletions

File tree

CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#TESTAR v2.8.4 (12-Mar-2026)
2+
- Remove abstract actionIds from LLM ActionHistory
3+
- Update getElementDescription prioritty and length
4+
- Add web aria tags to state model abstraction tags
5+
6+
17
#TESTAR v2.8.3 (11-Mar-2026)
28
- Add aria properties to WdTags
39

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.8.3
1+
2.8.4

core/src/org/testar/StateManagementTags.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/***************************************************************************************************
22
*
3-
* Copyright (c) 2018 - 2025 Open Universiteit - www.ou.nl
4-
* Copyright (c) 2018 - 2025 Universitat Politecnica de Valencia - www.upv.es
3+
* Copyright (c) 2018 - 2026 Open Universiteit - www.ou.nl
4+
* Copyright (c) 2018 - 2026 Universitat Politecnica de Valencia - www.upv.es
55
*
66
* Redistribution and use in source and binary forms, with or without
77
* modification, are permitted provided that the following conditions are met:
@@ -320,8 +320,10 @@ public enum Group {General, ControlPattern, WebDriver}
320320
public static final Tag<String> WebWidgetDisplay = Tag.from("Web Widget display", String.class);
321321
public static final Tag<Boolean> WebWidgetIsOffScreen = Tag.from("Web Widget Is Off Screen", Boolean.class);
322322
public static final Tag<String> WebWidgetSrc = Tag.from("Web Widget src", String.class);
323-
public static final Tag<String> WebWidgetPlaceholder= Tag.from("Web Widget placeholder", String.class);
323+
public static final Tag<String> WebWidgetPlaceholder = Tag.from("Web Widget placeholder", String.class);
324324
public static final Tag<Boolean> WebWidgetIsDisabled = Tag.from("Web Widget Is Disabled", Boolean.class);
325+
public static final Tag<String> WebWidgetAriaLabel = Tag.from("Web Widget Aria Label", String.class);
326+
public static final Tag<String> WebWidgetAriaLabelledBy = Tag.from("Web Widget Aria Labelled By", String.class);
325327

326328

327329
// a set containing the tags that are available for state management
@@ -413,6 +415,8 @@ public enum Group {General, ControlPattern, WebDriver}
413415
add(WebWidgetSrc);
414416
add(WebWidgetPlaceholder);
415417
add(WebWidgetIsDisabled);
418+
add(WebWidgetAriaLabel);
419+
add(WebWidgetAriaLabelledBy);
416420
}
417421
};
418422

@@ -510,6 +514,8 @@ public static boolean isStateManagementTag(Tag<?> tag) {
510514
settingsMap.put(WebWidgetSrc, "WebWidgetSrc");
511515
settingsMap.put(WebWidgetPlaceholder, "WebWidgetPlaceholder");
512516
settingsMap.put(WebWidgetIsDisabled, "WebWidgetIsDisabled");
517+
settingsMap.put(WebWidgetAriaLabel, "WebWidgetAriaLabel");
518+
settingsMap.put(WebWidgetAriaLabelledBy, "WebWidgetAriaLabelledBy");
513519
}
514520

515521
// a mapping of a tag to its group
@@ -597,6 +603,8 @@ public static boolean isStateManagementTag(Tag<?> tag) {
597603
put(WebWidgetSrc, Group.WebDriver);
598604
put(WebWidgetPlaceholder, Group.WebDriver);
599605
put(WebWidgetIsDisabled, Group.WebDriver);
606+
put(WebWidgetAriaLabel, Group.WebDriver);
607+
put(WebWidgetAriaLabelledBy, Group.WebDriver);
600608
}
601609
};
602610

testar/resources/prompts/fewshot_gemini_action.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"role": "user",
2828
"parts": [
2929
{
30-
"text": "We are testing the \"Demo\" web application. The objective of the test is to log in with username \"Test\" and password \"Star\". The following actions are available: ACF6HU: Click Home, ACKO87: Type into TextField Username, AC3B4T: Type into TextField Password, AC78TY: Click Log In, ACR11L: Click Register. This is the last action we executed: ACKO87: Typed Test into TextField Username. Which action should be executed to accomplish the test goal?"
30+
"text": "We are testing the \"Demo\" web application. The objective of the test is to log in with username \"Test\" and password \"Star\". The following actions are available: ACF6HU: Click Home, ACKO87: Type into TextField Username, AC3B4T: Type into TextField Password, AC78TY: Click Log In, ACR11L: Click Register. This is the last action we executed: Typed Test into TextField Username. Which action should be executed to accomplish the test goal?"
3131
}
3232
]
3333
},
@@ -43,7 +43,7 @@
4343
"role": "user",
4444
"parts": [
4545
{
46-
"text": "We are testing the \"Demo\" web application. The objective of the test is to log in with username \"Test\" and password \"Star\". The following actions are available: ACF6HU: Click Home, ACKO87: Type into TextField Username, AC3B4T: Type into TextField Password, AC78TY: Click Log In, ACR11L: Click Register. These are the last 2 actions we executed: ACKO87: Typed Test into TextField Username, AC3B4T: Typed Star into TextField Password. Which action should be executed to accomplish the test goal?"
46+
"text": "We are testing the \"Demo\" web application. The objective of the test is to log in with username \"Test\" and password \"Star\". The following actions are available: ACF6HU: Click Home, ACKO87: Type into TextField Username, AC3B4T: Type into TextField Password, AC78TY: Click Log In, ACR11L: Click Register. These are the last 2 actions we executed: Typed Test into TextField Username, Typed Star into TextField Password. Which action should be executed to accomplish the test goal?"
4747
}
4848
]
4949
},

testar/resources/prompts/fewshot_openai_action.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
},
1414
{
1515
"role": "user",
16-
"content": "We are testing the \"Demo\" web application. The objective of the test is to log in with username \"Test\" and password \"Star\". The following actions are available: ACF6HU: Click Home, ACKO87: Type into TextField Username, AC3B4T: Type into TextField Password, AC78TY: Click Log In, ACR11L: Click Register. This is the last action we executed: ACKO87: Typed Test into TextField Username. Which action should be executed to accomplish the test goal?"
16+
"content": "We are testing the \"Demo\" web application. The objective of the test is to log in with username \"Test\" and password \"Star\". The following actions are available: ACF6HU: Click Home, ACKO87: Type into TextField Username, AC3B4T: Type into TextField Password, AC78TY: Click Log In, ACR11L: Click Register. This is the last action we executed: Typed Test into TextField Username. Which action should be executed to accomplish the test goal?"
1717
},
1818
{
1919
"role": "assistant",
2020
"content": "{\"actionId\":\"AC3B4T\",\"input\":\"Star\"}"
2121
},
2222
{
2323
"role": "user",
24-
"content": "We are testing the \"Demo\" web application. The objective of the test is to log in with username \"Test\" and password \"Star\". The following actions are available: ACF6HU: Click Home, ACKO87: Type into TextField Username, AC3B4T: Type into TextField Password, AC78TY: Click Log In, ACR11L: Click Register. These are the last 2 actions we executed: ACKO87: Typed Test into TextField Username, AC3B4T: Typed Star into TextField Password. Which action should be executed to accomplish the test goal?"
24+
"content": "We are testing the \"Demo\" web application. The objective of the test is to log in with username \"Test\" and password \"Star\". The following actions are available: ACF6HU: Click Home, ACKO87: Type into TextField Username, AC3B4T: Type into TextField Password, AC78TY: Click Log In, ACR11L: Click Register. These are the last 2 actions we executed: Typed Test into TextField Username, Typed Star into TextField Password. Which action should be executed to accomplish the test goal?"
2525
},
2626
{
2727
"role": "assistant",

testar/resources/prompts/fewshot_openai_action_control.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@
1313
},
1414
{
1515
"role": "user",
16-
"content": "We are testing the \"Demo\" web application. The objective of the test is to log in with username \"Test\" and password \"Star\". The following actions are available: ACF6HU: Click Home, ACOP45: Hit the ESC key, ACKO87: Type into TextField Username, AC3B4T: Type into TextField Password, AC78TY: Click Log In, ACR11L: Click Register. This is the last action we executed: ACOP45: Hit the ESC key. Which action should be executed to accomplish the test goal?"
16+
"content": "We are testing the \"Demo\" web application. The objective of the test is to log in with username \"Test\" and password \"Star\". The following actions are available: ACF6HU: Click Home, ACOP45: Hit the ESC key, ACKO87: Type into TextField Username, AC3B4T: Type into TextField Password, AC78TY: Click Log In, ACR11L: Click Register. This is the last action we executed: Hit the ESC key. Which action should be executed to accomplish the test goal?"
1717
},
1818
{
1919
"role": "assistant",
2020
"content": "{\"actionId\":\"ACKO87\",\"input\":\"Test\"}"
2121
},
2222
{
2323
"role": "user",
24-
"content": "We are testing the \"Demo\" web application. The objective of the test is to log in with username \"Test\" and password \"Star\". The following actions are available: ACF6HU: Click Home, ACOP45: Hit the ESC key, ACKO87: Type into TextField Username, AC3B4T: Type into TextField Password, AC78TY: Click Log In, ACR11L: Click Register. These are the last 2 actions we executed: ACOP45: Hit the ESC key, ACKO87: Typed Test into TextField Username. Which action should be executed to accomplish the test goal?"
24+
"content": "We are testing the \"Demo\" web application. The objective of the test is to log in with username \"Test\" and password \"Star\". The following actions are available: ACF6HU: Click Home, ACOP45: Hit the ESC key, ACKO87: Type into TextField Username, AC3B4T: Type into TextField Password, AC78TY: Click Log In, ACR11L: Click Register. These are the last 2 actions we executed: Hit the ESC key, Typed Test into TextField Username. Which action should be executed to accomplish the test goal?"
2525
},
2626
{
2727
"role": "assistant",
2828
"content": "{\"actionId\":\"AC3B4T\",\"input\":\"Star\"}"
2929
},
3030
{
3131
"role": "user",
32-
"content": "We are testing the \"Demo\" web application. The objective of the test is to log in with username \"Test\" and password \"Star\". The following actions are available: ACF6HU: Click Home, ACOP45: Hit the ESC key, ACKO87: Type into TextField Username, AC3B4T: Type into TextField Password, AC78TY: Click Log In, ACR11L: Click Register. These are the last 3 actions we executed: ACOP45: Hit the ESC key, ACKO87: Typed Test into TextField Username, AC3B4T: Typed Star into TextField Password. Which action should be executed to accomplish the test goal?"
32+
"content": "We are testing the \"Demo\" web application. The objective of the test is to log in with username \"Test\" and password \"Star\". The following actions are available: ACF6HU: Click Home, ACOP45: Hit the ESC key, ACKO87: Type into TextField Username, AC3B4T: Type into TextField Password, AC78TY: Click Log In, ACR11L: Click Register. These are the last 3 actions we executed: Hit the ESC key, Typed Test into TextField Username, Typed Star into TextField Password. Which action should be executed to accomplish the test goal?"
3333
},
3434
{
3535
"role": "assistant",

testar/src/org/testar/action/priorization/llm/ActionHistory.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,14 @@ public String toString() {
110110
for (var action : actions) {
111111
Widget widget = action.get(Tags.OriginWidget);
112112
String type = action.get(Tags.Role).name();
113-
String actionId = action.get(Tags.AbstractID, "Unknown ActionId");
114113
String description = widget.get(descriptionTag, "Unknown Widget");
115114

116115
if(action instanceof WdSelectListAction) {
117116
// Special case for combobox/select list actions
118117
WdSelectListAction selectListAction = (WdSelectListAction) action;
119118
String selectWidget = selectListAction.getTarget();
120119
String value = selectListAction.getValue();
121-
builder.append(String.format("%s: Set value of ComboBox '%s' to '%s'", actionId, selectWidget, value));
120+
builder.append(String.format("Set value of ComboBox '%s' to '%s'", selectWidget, value));
122121
} else {
123122
switch(type) {
124123
case "ClickTypeInto":
@@ -127,24 +126,24 @@ public String toString() {
127126
case "RemoteScrollType":
128127
String input = getCompoundActionInputText(action);
129128
// TODO: Differentiate between types of input fields (numeric, password, etc.)
130-
builder.append(String.format("%s: Typed '%s' in TextField '%s'", actionId, input, description));
129+
builder.append(String.format("Typed '%s' in TextField '%s'", input, description));
131130
break;
132131
case "LeftClickAt":
133132
case "RemoteClick":
134133
case "RemoteScrollClick":
135-
builder.append(String.format("%s: Clicked on '%s'", actionId, description));
134+
builder.append(String.format("Clicked on '%s'", description));
136135
break;
137136
case "HistoryBackScript":
138137
// TODO: Decide if it makes sense to rely on the LLM to make this control decision
139-
builder.append(String.format("%s: Go History back in the browser", actionId));
138+
builder.append("Go History back in the browser");
140139
break;
141140
case "CloseTabScript":
142141
// TODO: Decide if it makes sense to rely on the LLM to make this control decision
143-
builder.append(String.format("%s: Close current browser tab", actionId));
142+
builder.append("Close current browser tab");
144143
break;
145144
case "HitESC":
146145
// TODO: Decide if it makes sense to rely on the LLM to make this control decision
147-
builder.append(String.format("%s: Hit the ESC key", actionId));
146+
builder.append("Hit the ESC key");
148147
break;
149148
default:
150149
logger.log(Level.WARN, "Unsupported action type for action history: " + type);

testar/src/org/testar/monkey/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
public class Main {
6666

67-
public static final String TESTAR_VERSION = "v2.8.3 (11-Mar-2026)";
67+
public static final String TESTAR_VERSION = "v2.8.4 (12-Mar-2026)";
6868

6969
//public static final String TESTAR_DIR_PROPERTY = "DIRNAME"; //Use the OS environment to obtain TESTAR directory
7070
public static final String SETTINGS_FILE = "test.settings";

testar/test/org/testar/action/priorization/llm/TestActionHistory.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ public void test_history_web_click_action() {
4343
ActionHistory actionHistory = new ActionHistory(1);
4444
actionHistory.addToHistory(web_click_action);
4545
assertTrue(actionHistory.getActions().contains(web_click_action));
46-
assertTrue(actionHistory.toString().contains("This is the last action we executed: AID_click:"));
46+
assertTrue(actionHistory.toString().contains("This is the last action we executed:"));
47+
assertTrue(!actionHistory.toString().contains("AID_click"));
4748
assertTrue(actionHistory.toString().contains("Clicked on 'clickable_widget_desc'"));
4849
}
4950

@@ -63,7 +64,8 @@ public void test_history_web_type_action() {
6364
ActionHistory actionHistory = new ActionHistory(1);
6465
actionHistory.addToHistory(web_type_action);
6566
assertTrue(actionHistory.getActions().contains(web_type_action));
66-
assertTrue(actionHistory.toString().contains("This is the last action we executed: AID_type:"));
67+
assertTrue(actionHistory.toString().contains("This is the last action we executed:"));
68+
assertTrue(!actionHistory.toString().contains("AID_type"));
6769
assertTrue(actionHistory.toString().contains("Typed 'LLM_text' in TextField 'typeable_widget_desc'"));
6870
}
6971

@@ -82,7 +84,8 @@ public void test_history_web_select_action() {
8284
ActionHistory actionHistory = new ActionHistory(1);
8385
actionHistory.addToHistory(web_select_action);
8486
assertTrue(actionHistory.getActions().contains(web_select_action));
85-
assertTrue(actionHistory.toString().contains("This is the last action we executed: AID_select:"));
87+
assertTrue(actionHistory.toString().contains("This is the last action we executed:"));
88+
assertTrue(!actionHistory.toString().contains("AID_select"));
8689
assertTrue(actionHistory.toString().contains("Set value of ComboBox 'combobox_widget_web_id' to 'Saab'"));
8790
}
8891

@@ -93,7 +96,8 @@ public void test_history_android_type_action() {
9396
ActionHistory actionHistory = new ActionHistory(1);
9497
actionHistory.addToHistory(android_type_action);
9598
assertTrue(actionHistory.getActions().contains(android_type_action));
96-
assertTrue(actionHistory.toString().contains("This is the last action we executed: AID_android_action_type:"));
99+
assertTrue(actionHistory.toString().contains("This is the last action we executed:"));
100+
assertTrue(!actionHistory.toString().contains("AID_android_action_type"));
97101
assertTrue(actionHistory.toString().contains("Typed 'LLM_text' in TextField 'android_edit_widget_desc'"));
98102
}
99103

@@ -108,7 +112,8 @@ public void test_history_web_remote_click_action() {
108112
ActionHistory actionHistory = new ActionHistory(1);
109113
actionHistory.addToHistory(web_remote_click_action);
110114
assertTrue(actionHistory.getActions().contains(web_remote_click_action));
111-
assertTrue(actionHistory.toString().contains("This is the last action we executed: AID_remote_click:"));
115+
assertTrue(actionHistory.toString().contains("This is the last action we executed:"));
116+
assertTrue(!actionHistory.toString().contains("AID_remote_click"));
112117
assertTrue(actionHistory.toString().contains("Clicked on 'remote_click_widget'"));
113118
}
114119

@@ -123,7 +128,8 @@ public void test_history_web_remote_scroll_click_action() {
123128
ActionHistory actionHistory = new ActionHistory(1);
124129
actionHistory.addToHistory(web_remote_scroll_click_action);
125130
assertTrue(actionHistory.getActions().contains(web_remote_scroll_click_action));
126-
assertTrue(actionHistory.toString().contains("This is the last action we executed: AID_remote_scroll_click:"));
131+
assertTrue(actionHistory.toString().contains("This is the last action we executed:"));
132+
assertTrue(!actionHistory.toString().contains("AID_remote_scroll_click"));
127133
assertTrue(actionHistory.toString().contains("Clicked on 'remote_scroll_click_widget'"));
128134
}
129135

@@ -139,7 +145,8 @@ public void test_history_web_remote_type_action() {
139145
ActionHistory actionHistory = new ActionHistory(1);
140146
actionHistory.addToHistory(web_remote_type_action);
141147
assertTrue(actionHistory.getActions().contains(web_remote_type_action));
142-
assertTrue(actionHistory.toString().contains("This is the last action we executed: AID_remote_type:"));
148+
assertTrue(actionHistory.toString().contains("This is the last action we executed:"));
149+
assertTrue(!actionHistory.toString().contains("AID_remote_type"));
143150
assertTrue(actionHistory.toString().contains("Typed 'remote_text' in TextField 'remote_type_widget'"));
144151
}
145152

@@ -155,7 +162,8 @@ public void test_history_web_remote_scroll_type_action() {
155162
ActionHistory actionHistory = new ActionHistory(1);
156163
actionHistory.addToHistory(web_remote_scroll_type_action);
157164
assertTrue(actionHistory.getActions().contains(web_remote_scroll_type_action));
158-
assertTrue(actionHistory.toString().contains("This is the last action we executed: AID_remote_scroll_type:"));
165+
assertTrue(actionHistory.toString().contains("This is the last action we executed:"));
166+
assertTrue(!actionHistory.toString().contains("AID_remote_scroll_type"));
159167
assertTrue(actionHistory.toString().contains("Typed 'remote_scroll_text' in TextField 'remote_scroll_type_widget'"));
160168
}
161169

testar/test/org/testar/llm/prompt/TestActionStandardPromptGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void test_prompt_generator_title_with_history() {
117117
Assert.isTrue(prompt.contains("The following actions are available:"));
118118
Assert.isTrue(prompt.contains("AID_type: Type in Field 'typeable_widget_title'"));
119119
Assert.isTrue(prompt.contains("AID_click: Click on 'clickable_widget_title'"));
120-
Assert.isTrue(prompt.contains("This is the last action we executed: AID_type: Typed 'LLM_text' in TextField 'typeable_widget_title'"));
120+
Assert.isTrue(prompt.contains("This is the last action we executed: Typed 'LLM_text' in TextField 'typeable_widget_title'"));
121121
Assert.isTrue(prompt.contains("Which action should be executed to accomplish the test goal?"));
122122
}
123123
}

0 commit comments

Comments
 (0)