Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ private void configureFirefoxDriver(WebDriver driver) {

private void configureHtmlUnitDriver(WebDriver driver) {
if (driver instanceof HtmlUnitDriver htmlUnitDriver) {
var options = htmlUnitDriver.getWebClient().getOptions();

// Configure timeout for better compatibility with slower CI environments (especially Windows)
// Default 60 seconds should be sufficient for most scenarios including broker flows with OTP
int timeoutMillis = Integer.parseInt(System.getProperty("htmlunit.timeout", "60000"));
log.infof("Setting HtmlUnit timeout: %d ms", timeoutMillis);
options.setTimeout(timeoutMillis);

// Configure TLS settings if provided
final var keystore = System.getProperty(HTML_UNIT_SSL_KEYSTORE_PROP);
final var keystorePassword = System.getProperty(HTML_UNIT_SSL_KEYSTORE_PASSWORD_PROP);
final var keystoreType = System.getProperty(HTML_UNIT_SSL_KEYSTORE_TYPE_PROP);
Expand All @@ -115,7 +124,6 @@ private void configureHtmlUnitDriver(WebDriver driver) {
if (keystore != null && keystorePassword != null && keystoreType != null) {
log.infof("Keystore '%s', password '%s', type '%s'", keystore, keystorePassword, keystoreType);

var options = htmlUnitDriver.getWebClient().getOptions();
options.setUseInsecureSSL(true);
try {
options.setSSLClientCertificateKeyStore(new File(keystore).toURI().toURL(), keystorePassword, keystoreType);
Expand Down
Loading