Skip to content

Commit

Permalink
fix: handle Sikuli not reachable with Selenium 4 (sikuli is now on sp…
Browse files Browse the repository at this point in the history
…ecific container port and not anymore on selenium node port)
  • Loading branch information
lucashimpens committed Feb 13, 2025
1 parent efc365a commit b7aba2f
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.net.Proxy;
import java.net.URL;
import java.net.URLConnection;
import java.net.ConnectException;
import java.util.UUID;

import org.apache.commons.codec.binary.Base64;
Expand All @@ -45,7 +46,6 @@
import org.apache.tika.mime.MimeTypes;
import org.cerberus.core.crud.entity.Parameter;
import org.cerberus.core.crud.service.IParameterService;
import org.cerberus.core.crud.service.impl.ParameterService;
import org.cerberus.core.engine.entity.Identifier;
import org.cerberus.core.engine.entity.MessageEvent;
import org.cerberus.core.engine.entity.Session;
Expand Down Expand Up @@ -259,7 +259,8 @@ public boolean isSikuliServerReachableOnRobot(Session session) {
if (connection == null || connection.getResponseCode() != 200) {
return false;
}

} catch (ConnectException exception) { //Handle Sikuli not reachable with Selenium 4
return false;
} catch (IOException ex) {
LOG.warn(ex);
return false;
Expand Down Expand Up @@ -298,10 +299,11 @@ public boolean isSikuliServerReachableOnNode(Session session) {
}

if (connection == null || connection.getResponseCode() != 200) {
LOG.info("Responce code different from 200 when calling '" + urlToConnect + "'. Disable Cerberus extension features.");
LOG.warn("Response code different from 200 when calling '" + urlToConnect + "'");
return false;
}

} catch (ConnectException exception) { //Handle Sikuli not reachable with Selenium 4
return false;
} catch (IOException ex) {
LOG.warn("Exception catch when calling '" + urlToConnect + "' " + ex, ex);
return false;
Expand Down

0 comments on commit b7aba2f

Please sign in to comment.