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 11, 2025
1 parent 43ff8a9 commit 16e48e5
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.URL;
import java.net.URLConnection;
import java.net.*;
import java.util.UUID;

import org.apache.commons.codec.binary.Base64;
Expand All @@ -45,7 +40,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 +253,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 +293,11 @@ public boolean isSikuliServerReachableOnNode(Session session) {
}

if (connection == null || connection.getResponseCode() != 200) {
LOG.warn("Responce code different from 200 when calling '" + urlToConnect + "'");
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 16e48e5

Please sign in to comment.