diff --git a/RELEASENOTE.md b/RELEASENOTE.md
index bb134459c..f0a5023ad 100644
--- a/RELEASENOTE.md
+++ b/RELEASENOTE.md
@@ -1,6 +1,12 @@
Selenese Runner Java Relase Note
================================
+### 4.3.0
+
+* Catch up Selenium 4.8.1 and update dependency versions.
+ * Fix several problems associated with the update.
+* Remove dependency on `xalan` for security reason. (#337)
+
### 4.2.0
* Catch up Selenium 4.4.0 and update dependency versions.
diff --git a/pom.xml b/pom.xml
index e9f08e2fd..a9500a240 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,12 +45,12 @@
1.8
1.8
true
- 4.4.0
- 2.63.0
+ 4.8.1
+ 2.70.0
${htmlunit.version}
${htmlunit.version}
- 3.63.0
- 1.7.36
+ 4.8.0
+ 2.0.7
file://${basedir}/version-rules.xml
src/shade/java
target/shade-classes
@@ -390,7 +390,7 @@
org.apache.ant
ant-commons-net
- 1.10.12
+ 1.10.13
@@ -513,11 +513,6 @@
htmlunit-driver
${htmlunit-driver.version}
-
- io.netty
- netty-all
- 4.1.79.Final
-
com.google.guava
guava
@@ -573,12 +568,7 @@
ch.qos.logback
logback-classic
- 1.2.11
-
-
- xalan
- xalan
- 2.7.2
+ 1.3.6
com.google.inject
@@ -593,12 +583,12 @@
com.floreysoft
jmte
- 7.0.0
+ 7.0.2
com.google.code.gson
gson
- 2.9.1
+ 2.10.1
junit
@@ -664,7 +654,7 @@
org.glassfish.jaxb
jaxb-runtime
- 2.3.6
+ 2.3.8
diff --git a/run.sh b/run.sh
index 47c48cadc..4d3dc548c 100755
--- a/run.sh
+++ b/run.sh
@@ -27,9 +27,16 @@ do_script() {
local file="$1"; shift
set -x
case "$OSTYPE" in
- linux*|cygwin*)
+ linux*)
script -c "$*" "$file"
;;
+ cygwin*)
+ cmd=""
+ for a in "$@"; do
+ cmd="$cmd '$a'"
+ done
+ script -c "${cmd# }" "$file"
+ ;;
darwin*|*bsd*)
script "$file" "$@"
;;
diff --git a/src/main/java/jp/vmi/selenium/selenese/log/CookieMap.java b/src/main/java/jp/vmi/selenium/selenese/log/CookieMap.java
index 6743b6380..6f4a4c4f2 100644
--- a/src/main/java/jp/vmi/selenium/selenese/log/CookieMap.java
+++ b/src/main/java/jp/vmi/selenium/selenese/log/CookieMap.java
@@ -9,7 +9,6 @@
/**
* Map of Cookies.
*/
-@SuppressWarnings("serial")
public class CookieMap extends TreeMap {
/**
diff --git a/src/main/java/jp/vmi/selenium/selenese/parser/SeleneseCommandIterator.java b/src/main/java/jp/vmi/selenium/selenese/parser/SeleneseCommandIterator.java
index c450c7fd8..a757aa404 100644
--- a/src/main/java/jp/vmi/selenium/selenese/parser/SeleneseCommandIterator.java
+++ b/src/main/java/jp/vmi/selenium/selenese/parser/SeleneseCommandIterator.java
@@ -6,7 +6,6 @@
import javax.xml.transform.TransformerException;
-import org.apache.xpath.XPathAPI;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
diff --git a/src/main/java/jp/vmi/selenium/selenese/parser/SeleneseIteratorFactory.java b/src/main/java/jp/vmi/selenium/selenese/parser/SeleneseIteratorFactory.java
index 8b1a913d3..5e15397c4 100644
--- a/src/main/java/jp/vmi/selenium/selenese/parser/SeleneseIteratorFactory.java
+++ b/src/main/java/jp/vmi/selenium/selenese/parser/SeleneseIteratorFactory.java
@@ -6,7 +6,6 @@
import javax.xml.transform.TransformerException;
-import org.apache.xpath.XPathAPI;
import org.cyberneko.html.parsers.DOMParser;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
diff --git a/src/main/java/jp/vmi/selenium/selenese/parser/SeleneseTestCaseIterator.java b/src/main/java/jp/vmi/selenium/selenese/parser/SeleneseTestCaseIterator.java
index 6771b49d7..24d86c074 100644
--- a/src/main/java/jp/vmi/selenium/selenese/parser/SeleneseTestCaseIterator.java
+++ b/src/main/java/jp/vmi/selenium/selenese/parser/SeleneseTestCaseIterator.java
@@ -5,7 +5,6 @@
import javax.xml.transform.TransformerException;
import org.apache.commons.io.FilenameUtils;
-import org.apache.xpath.XPathAPI;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
diff --git a/src/main/java/jp/vmi/selenium/selenese/parser/XPathAPI.java b/src/main/java/jp/vmi/selenium/selenese/parser/XPathAPI.java
new file mode 100644
index 000000000..5044e8616
--- /dev/null
+++ b/src/main/java/jp/vmi/selenium/selenese/parser/XPathAPI.java
@@ -0,0 +1,57 @@
+package jp.vmi.selenium.selenese.parser;
+
+import javax.xml.transform.TransformerException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * org.apache.xpath.XPathAPI alternative.
+ */
+public class XPathAPI {
+
+ /**
+ * Select single node.
+ *
+ * @param document XML document.
+ * @param query query
+ * @return node
+ * @throws TransformerException exception.
+ */
+ public static Node selectSingleNode(Document document, String query) throws TransformerException {
+ XPathFactory f = XPathFactory.newInstance();
+ XPath xPath = f.newXPath();
+ try {
+ XPathExpression expr = xPath.compile(query);
+ return (Node) expr.evaluate(document, XPathConstants.NODE);
+ } catch (XPathExpressionException e) {
+ throw new TransformerException(e);
+ }
+ }
+
+ /**
+ * Select node list.
+ *
+ * @param document XML document.
+ * @param query query
+ * @return list of node
+ * @throws TransformerException exception.
+ */
+ public static NodeList selectNodeList(Document document, String query) throws TransformerException {
+ XPathFactory f = XPathFactory.newInstance();
+ XPath xPath = f.newXPath();
+ try {
+ XPathExpression expr = xPath.compile(query);
+ return (NodeList) expr.evaluate(document, XPathConstants.NODESET);
+ } catch (XPathExpressionException e) {
+ throw new TransformerException(e);
+ }
+ }
+
+}
diff --git a/src/main/java/jp/vmi/selenium/webdriver/ChromeDriverFactory.java b/src/main/java/jp/vmi/selenium/webdriver/ChromeDriverFactory.java
index 4a1662b6f..fa756b08f 100644
--- a/src/main/java/jp/vmi/selenium/webdriver/ChromeDriverFactory.java
+++ b/src/main/java/jp/vmi/selenium/webdriver/ChromeDriverFactory.java
@@ -41,8 +41,9 @@ public String getBrowserName() {
*/
public static ChromeOptions newChromeOptions(DriverOptions driverOptions) {
ChromeOptions options = new ChromeOptions();
- if (driverOptions.has(HEADLESS))
- options.setHeadless(driverOptions.getBoolean(HEADLESS));
+ options.addArguments("--remote-allow-origins=*"); // FIXME
+ if (driverOptions.has(HEADLESS) && driverOptions.getBoolean(HEADLESS))
+ options.addArguments("--headless=new");
Proxy proxy = newProxy(driverOptions);
if (proxy != null)
options.setProxy(proxy);
diff --git a/src/main/java/jp/vmi/selenium/webdriver/FirefoxDriverFactory.java b/src/main/java/jp/vmi/selenium/webdriver/FirefoxDriverFactory.java
index c57483586..216611beb 100644
--- a/src/main/java/jp/vmi/selenium/webdriver/FirefoxDriverFactory.java
+++ b/src/main/java/jp/vmi/selenium/webdriver/FirefoxDriverFactory.java
@@ -44,8 +44,8 @@ public String getBrowserName() {
*/
public static FirefoxOptions newFirefoxOptions(DriverOptions driverOptions) {
FirefoxOptions options = new FirefoxOptions();
- if (driverOptions.has(HEADLESS))
- options.setHeadless(driverOptions.getBoolean(HEADLESS));
+ if (driverOptions.has(HEADLESS) && driverOptions.getBoolean(HEADLESS))
+ options.addArguments("--headless");
Proxy proxy = newProxy(driverOptions);
if (proxy != null)
options.setProxy(proxy);
@@ -79,7 +79,7 @@ public WebDriver newInstance(DriverOptions driverOptions) {
public static void setDriverSpecificCapabilitiesForRemoteWebDriver(DesiredCapabilities caps, DriverOptions driverOptions) {
String firefoxBin = getFirefoxBinary(driverOptions);
if (firefoxBin != null) {
- caps.setCapability(FirefoxDriver.Capability.BINARY, firefoxBin);
+ caps.setCapability(FirefoxDriver.SystemProperty.BROWSER_BINARY, firefoxBin);
log.info("Firefox binary: {}", firefoxBin);
}
if (driverOptions.has(CLI_ARGS))
@@ -91,7 +91,7 @@ public static void setDriverSpecificCapabilitiesForRemoteWebDriver(DesiredCapabi
setProxyConfiguration(profile, driverOptions);
}
if (profile != null) {
- caps.setCapability(FirefoxDriver.Capability.PROFILE, profile);
+ caps.setCapability(FirefoxDriver.SystemProperty.BROWSER_PROFILE, profile);
}
}
diff --git a/src/test/java/jp/vmi/selenium/testutils/TestUtils.java b/src/test/java/jp/vmi/selenium/testutils/TestUtils.java
index 601737349..b16d32015 100644
--- a/src/test/java/jp/vmi/selenium/testutils/TestUtils.java
+++ b/src/test/java/jp/vmi/selenium/testutils/TestUtils.java
@@ -81,7 +81,8 @@ public static List