Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not transform value %{"element-6066-11e4-a52e-4f735466cecf" => "d2c5deba-fdff-48db-b319-694aa6542c81"} to element #243

Closed
maryolivier opened this issue Aug 6, 2019 · 2 comments

Comments

@maryolivier
Copy link

maryolivier commented Aug 6, 2019

Background

Using the latest Chrome 76.0.3809.87 and ChromeDriver 76.0.3809.68 with the latest Selenium 3.141.59. I can do things like navigate_to() and visible_in_page?() but cannot interact with the elements on the page, due to the error. I did some comparison between the applied additional_capabilities using the latest selenium version vs. the version that works for me (2.49; anything above this produces the error), and the only difference is that platform="ANY" is applied automatically in the version that works for me. I have tried adding platform="ANY" to the capabilities (as shown below), but it doesnt seem to be applied. Nevertheless, I am at a standstill and it seems to be a Hound related failure.

Config

test.exs:

config :hound,
  driver: "selenium",
  browser: "chrome_headless",
  app_port: 4001,
  genserver_timeout: 480_000

integration_case (setup file):

setup tags do
    :ok = Ecto.Adapters.SQL.Sandbox.checkout(App.Repo)
    metadata = Phoenix.Ecto.SQL.Sandbox.metadata_for(App.Repo, self())

    unless tags[:async] do
      Ecto.Adapters.SQL.Sandbox.mode(App.Repo, {:shared, self()})
    end

    Hound.start_session(
      additional_capabilities: %{
        browserName: "chrome",
        version: "76.0.3809.87",
        platform: "ANY",
        javascriptEnabled: true,
        chromeOptions: %{
          "args" => [
            "--user-agent=#{Hound.Browser.user_agent(:chrome) |> Hound.Metadata.append(metadata)}",
            "--disable-gpu",
            "--window-size=2000x1125"
          ]
        }
      }
    )

    navigate_to("/")

    parent = self()
    on_exit fn-> Hound.end_session(parent) end
    :ok
  end

Error

Upon running a function like this (searching for elements on the page):

parent_object =
      :class
      |> find_all_elements("InputLabel")
      |> Enum.find(&String.contains?(inner_html(&1), ~s(#{label})))

find_within_element(parent_object, :class, "Input")

I receive this error:

** (Hound.InvalidElementError) Could not transform value %{"element-6066-11e4-a52e-4f735466cecf" => "d2c5deba-fdff-48db-b319-694aa6542c81"} to element
@maryolivier
Copy link
Author

maryolivier commented Aug 7, 2019

this seems to be fixed in the latest code from master, closing this.

@ilgarm
Copy link

ilgarm commented Oct 11, 2019

hi, any plans when a released version with this fix will appear in hex?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants