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
find_element with :link_text does not work with phantomjs #116
Comments
@thiagogabriel Hi, thanks for reporting. https://github.com/tuvistavie/hound-issue-116 Could it be that the form is not properly submitted when using PhantomJS? |
@tuvistavie I'm digging deeper and found out that the problem happens on |
I believe the menu get's collapsed when the page is opened on phantomjs. Is it possible to set a configuration on test.exs to define a bigger window, or the only solution is use something like Hound.Helpers.Window.html#maximize_window before very test? Thanks. |
I don't think there is any way to set the window size from the configuration when using phantomjs. Otherwise, I just tried with def custom_hound_session(context \\ %{}) do
Hound.start_session(Map.get(context, :hound_options, []))
current_window_handle |> maximize_window
end
setup :custom_hound_session Note that this example requires Elixir 1.3 |
@tuvistavie is this a good solution for Elixir 1.2? thiagogabriel/phoenix_hound_issue_116@00a19bd |
This solution seems perfect to me 👍 |
@tuvistavie I think we do allow passing custom options to browsers/drivers. But maximizing window after starting the browser is a better & and more generic way of doing it. |
@thiagogabriel Just checked the commit you linked to. |
I have the same problem with links hidden in the
I've also tried
It works however if I use the =~ operator
Or if I set an id on the link and find the element by that id
Regarding the case where I had
I'm also unable to find them by text, I tried using both the inner plain text of the link:
and the full html inside the link
Both can't find the elements, but If I get rid of the |
I'm trying to click on an element based on the link name but the element is not found even with
find_element(:link_text, "Home")
.I'm using Elixir 1.2.3, Phoenix 1.1.6 and PhantomJS 2.1.1.
When I replaced the driver with selenium,
find_element(:link_text, ...)
andclick({:link_text, ...})
started working.Is this a known problem and is there a way to solve this?
My configurations are:
Running
phantomjs --wd
on a different tmux tab.I'm running the tests using:
mix test
The text was updated successfully, but these errors were encountered: