hound icon indicating copy to clipboard operation
hound copied to clipboard

fill_field produces: protocol String.Chars not implemented for %Hound.Element{uuid: ":wdc:1487841743209"}

Open mlankenau opened this issue 8 years ago • 10 comments

Hi there,

We do a find_element(:css, "some css selector", 20) |> fill_field("some text")

The fill_field produces the error: ** (Protocol.UndefinedError) protocol String.Chars not implemented for %Hound.Element{uuid: ":wdc:1487841743209"} stacktrace: (elixir) lib/string/chars.ex:3: String.Chars.impl_for!/1 (elixir) lib/string/chars.ex:17: String.Chars.to_string/1 (hound) lib/hound/helpers/element.ex:106: Hound.Helpers.Element.clear_field/1 (hound) lib/hound/helpers/element.ex:69: Hound.Helpers.Element.fill_field/2

We are working on hound master. Any idears are highly appreciated.

BR

mlankenau avatar Feb 23 '17 09:02 mlankenau

Ah, it happens with both phantom_js and chromedriver. Stepping back to 1.0.3 solves the problem for the moment.

mlankenau avatar Feb 23 '17 09:02 mlankenau

Hi, could you give me a website where I can reproduce this please? I just tried a few examples but could not reproduce. For example, with selenium + geckodriver:

use Hound.Helpers
Hound.start_session
navigate_to "https://github.com"                                           
find_element(:css, ~s([name="user[login]"])) |> fill_field("[email protected]")

danhper avatar Feb 23 '17 15:02 danhper

Hi, sorry the website is not public available. Even with the 1.0.3 the problem came back to me. So it is not version related. Deleting all the files in _build folder solved the issue for me again. So I am not sure if that is a hound problem or something with my env. If am the only one having the issue we can close the issue. Deleting the binaries is a workaround.

mlankenau avatar Feb 24 '17 19:02 mlankenau

That's very weird. Please let us know if you discover something. Thanks for reporting!

danhper avatar Feb 25 '17 05:02 danhper

We have an Umbrella Project, maybe it is related. Thx for taking care...

mlankenau avatar Feb 25 '17 09:02 mlankenau

We're experiencing the same problem regularly, but didn't find a pattern when yet.

It's also happening in the context of an umbrella project. Unfortunately it's also not public.

I'm deleting the file _build/test/consolidated/Elixir.String.Chars.beam anytime this error arises, which solves the problem for some time.

marcelotto avatar Apr 26 '17 02:04 marcelotto

I believe this happened to me when I moved my gettext dependency from my child app to my top-level umbrella app. Never saw the error until I did that.

The module only appears to be used for Error reporting within my app, but after I moved the dependency, I consistently got the OP's error message until I deleted the compiled beam file Elixir.String.Chars.beam as suggested above.

darksheik avatar Jul 11 '17 13:07 darksheik

We have the same issue and also an Umbrella Project.

arfl avatar Sep 29 '17 07:09 arfl

Confirming this is still an issue in umbrella projects and that @marcelotto's solution works as a temporary solution.

chrislaskey avatar Feb 22 '19 21:02 chrislaskey

Same as above; private umbrella app. Running mix clean solved the issue for me.

mdarby avatar Feb 06 '20 21:02 mdarby