Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#TESTAR v2.8.7 (6-Apr-2026)
- Bump io.github.bonigarcia:webdrivermanager from 6.3.3 to 6.3.4
- Fix parse llm selected ESC action
- Add WdDriver configurable user data and profile


#TESTAR v2.8.6 (24-Mar-2026)
- Remove linux AtSpi subproject
- Remove unused Tags
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8.6
2.8.7
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ subprojects {
// https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java
implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.41.0'
// https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager
implementation group: 'io.github.bonigarcia', name: 'webdrivermanager', version: '6.3.3'
implementation group: 'io.github.bonigarcia', name: 'webdrivermanager', version: '6.3.4'
// https://mvnrepository.com/artifact/io.appium/java-client
implementation group: 'io.appium', name: 'java-client', version: '10.1.0'
// https://mvnrepository.com/artifact/com.orientechnologies/orientdb-graphdb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.testar.monkey.Util;
import org.testar.monkey.alayer.Action;
import org.testar.monkey.alayer.Color;
import org.testar.monkey.alayer.FillPattern;
Expand Down Expand Up @@ -189,7 +190,7 @@ private boolean updateTextAction(Action action, Action innerAction, String input
String widgetDesc = action.get(Tags.OriginWidget).get(Tags.Desc, "<no description>");
action.set(Tags.Desc, innerAction.getClass().getSimpleName() + " '" + inputText + "' into '" + widgetDesc + "'");

if(action.get(Tags.Visualizer) instanceof TextVisualizer) {
if(action.get(Tags.Visualizer, Util.NullVisualizer) instanceof TextVisualizer) {
TextVisualizer textVisualizer = (TextVisualizer) action.get(Tags.Visualizer);
Pen newPen = Pen.newPen().setColor(Color.Red).setFillPattern(FillPattern.Solid).setStrokeWidth(50).build();
action.set(Tags.Visualizer, textVisualizer.withText(inputText, newPen));
Expand Down
2 changes: 1 addition & 1 deletion testar/src/org/testar/monkey/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

public class Main {

public static final String TESTAR_VERSION = "v2.8.6 (24-Mar-2026)";
public static final String TESTAR_VERSION = "v2.8.7 (6-Apr-2026)";

//public static final String TESTAR_DIR_PROPERTY = "DIRNAME"; //Use the OS environment to obtain TESTAR directory
public static final String SETTINGS_FILE = "test.settings";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.testar.action.priorization.llm;

import static org.junit.Assert.assertEquals;

import java.util.HashSet;
import java.util.Set;

Expand All @@ -12,6 +14,8 @@
import org.testar.monkey.alayer.actions.CompoundAction;
import org.testar.monkey.alayer.actions.StdActionCompiler;
import org.testar.monkey.alayer.actions.Type;
import org.testar.monkey.alayer.actions.WdCloseTabAction;
import org.testar.monkey.alayer.actions.WdHistoryBackAction;
import org.testar.monkey.alayer.actions.WdRemoteScrollTypeAction;
import org.testar.monkey.alayer.actions.WdRemoteTypeAction;
import org.testar.monkey.alayer.actions.WdSelectListAction;
Expand Down Expand Up @@ -222,6 +226,42 @@ public void test_llm_selects_android_type_action() {
Assert.isTrue(innerText.equals("testar"));
}

@Test
public void test_parsing_hit_escape_action() {
String llmResponse = "```json{\"actionId\":\"AID_HitEsc\",\"input\":\"\"}```";
Set<Action> derivedActions = createDefaultDerivedActions(createState());

LlmParseActionResponse llmParseResponse = new LlmParseActionResponse();
LlmParseActionResult llmParseResult = llmParseResponse.parseLlmResponse(derivedActions, llmResponse);

assertEquals(LlmParseActionResult.ParseResult.SUCCESS, llmParseResult.getParseResult());
assertEquals("AID_HitEsc", llmParseResult.getActionToExecute().get(Tags.AbstractID));
}

@Test
public void test_parsing_wd_navigate_back_action() {
String llmResponse = "```json{\"actionId\":\"AID_NavBack\",\"input\":\"\"}```";
Set<Action> derivedActions = createDefaultDerivedActions(createState());

LlmParseActionResponse llmParseResponse = new LlmParseActionResponse();
LlmParseActionResult llmParseResult = llmParseResponse.parseLlmResponse(derivedActions, llmResponse);

assertEquals(LlmParseActionResult.ParseResult.SUCCESS, llmParseResult.getParseResult());
assertEquals("AID_NavBack", llmParseResult.getActionToExecute().get(Tags.AbstractID));
}

@Test
public void test_parsing_wd_close_tab_action() {
String llmResponse = "```json{\"actionId\":\"AID_CloseTab\",\"input\":\"\"}```";
Set<Action> derivedActions = createDefaultDerivedActions(createState());

LlmParseActionResponse llmParseResponse = new LlmParseActionResponse();
LlmParseActionResult llmParseResult = llmParseResponse.parseLlmResponse(derivedActions, llmResponse);

assertEquals(LlmParseActionResult.ParseResult.SUCCESS, llmParseResult.getParseResult());
assertEquals("AID_CloseTab", llmParseResult.getActionToExecute().get(Tags.AbstractID));
}

private static StateStub createState() {
StateStub createdState = new StateStub();
createdState.set(WdTags.WebTitle, "Page Title | State");
Expand All @@ -241,6 +281,9 @@ private static Set<Action> createDefaultDerivedActions(StateStub state) {
derivedActions.add(createSelectAction(state, "combobox_widget_desc", "combobox_widget_web_id",
"CID_combobox_widget", "AID_combobox_widget", "CID_select", "AID_select", "Saab"));
derivedActions.add(createAndroidTypeAction(state));
derivedActions.add(createHitEscAction(state, "CID_HitEsc", "AID_HitEsc"));
derivedActions.add(createWdHistoryBackAction(state, "CID_NavBack", "AID_NavBack"));
derivedActions.add(createWdCloseTabAction(state, "CID_CloseTab", "AID_CloseTab"));
return derivedActions;
}

Expand Down Expand Up @@ -321,4 +364,25 @@ private static Action createAndroidTypeAction(StateStub parentState) {
return action;
}

private static Action createHitEscAction(StateStub parentState, String actionConcreteId, String actionAbstractId) {
Action action = ac.hitESC(parentState);
action.set(Tags.ConcreteID, actionConcreteId);
action.set(Tags.AbstractID, actionAbstractId);
return action;
}

private static Action createWdHistoryBackAction(StateStub parentState, String actionConcreteId, String actionAbstractId) {
Action action = new WdHistoryBackAction(parentState);
action.set(Tags.ConcreteID, actionConcreteId);
action.set(Tags.AbstractID, actionAbstractId);
return action;
}

private static Action createWdCloseTabAction(StateStub parentState, String actionConcreteId, String actionAbstractId) {
Action action = new WdCloseTabAction(parentState);
action.set(Tags.ConcreteID, actionConcreteId);
action.set(Tags.AbstractID, actionAbstractId);
return action;
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright (c) 2018 - 2025 Open Universiteit - www.ou.nl
* Copyright (c) 2019 - 2025 Universitat Politecnica de Valencia - www.upv.es
* Copyright (c) 2018 - 2026 Open Universiteit - www.ou.nl
* Copyright (c) 2019 - 2026 Universitat Politecnica de Valencia - www.upv.es
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -74,6 +74,8 @@ public class WdDriver extends SUTBase {
public static boolean disableSecurity = false;
public static boolean remoteDebugging = false;
public static boolean disableGPU = true;
public static String userDataDir = "";
public static String profileDirectory = "";

private final Keyboard kbd = AWTKeyboard.build();
private final Mouse mouse = WdMouse.build();
Expand Down
10 changes: 8 additions & 2 deletions webdriver/src/org/testar/webdriver/manager/WdChromeManager.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright (c) 2025 Universitat Politecnica de Valencia - www.upv.es
* Copyright (c) 2025 Open Universiteit - www.ou.nl
* Copyright (c) 2025 - 2026 Universitat Politecnica de Valencia - www.upv.es
* Copyright (c) 2025 - 2026 Open Universiteit - www.ou.nl
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -103,6 +103,12 @@ public RemoteWebDriver createWebDriver(String chromeForTestingPath, String exten
if(WdDriver.disableGPU) {
options.addArguments("--disable-gpu");
}
if(WdDriver.userDataDir != null && !WdDriver.userDataDir.isEmpty()) {
options.addArguments("--user-data-dir=" + WdDriver.userDataDir);
}
if(WdDriver.profileDirectory != null && !WdDriver.profileDirectory.isEmpty()) {
options.addArguments("--profile-directory=" + WdDriver.profileDirectory);
}

Map<String, Object> prefs = new HashMap<>();
prefs.put("profile.default_content_setting_values.notifications", 1);
Expand Down
Loading