diff --git a/lib/wallaby/httpclient.ex b/lib/wallaby/httpclient.ex index 7b422715..27851d6a 100644 --- a/lib/wallaby/httpclient.ex +++ b/lib/wallaby/httpclient.ex @@ -77,12 +77,17 @@ defmodule Wallaby.HTTPClient do end end + # credo:disable-for-next-line Credo.Check.Refactor.CyclomaticComplexity defp check_for_response_errors(response) do case Map.get(response, "value") do %{"class" => "org.openqa.selenium.StaleElementReferenceException"} -> {:error, :stale_reference} + %{"message" => "Stale element reference" <> _} -> + {:error, :stale_reference} %{"message" => "stale element reference" <> _} -> {:error, :stale_reference} + %{"message" => "An element command failed because the referenced element is no longer available" <> _} -> + {:error, :stale_reference} %{"message" => "invalid selector" <> _} -> {:error, :invalid_selector} %{"class" => "org.openqa.selenium.InvalidSelectorException"} ->