-
Notifications
You must be signed in to change notification settings - Fork 50
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
Undefined method `getByXPath' #55
Comments
I'm getting this too. As far as I'm aware, there's no javascript on the page at all. It seems like the thing that causes it in my case is that the preceding step submits a login form, which sends a redirect back to the browser. This scenario works with rack-test. When I change the step to do a save_and_open_page instead, I get another undefined method error, this time for `asXml'. |
Sorry if I'm hijacking this issue, but it looks like this is very relevant to my situation: |
I get this error on local machines (OSX and Ubunto on Vagrant) and also on my hudson CI server. Sometimes the tests work fine and other times they fail. |
Matt: did you work out any way to set the accept header? Seems like Akephalos doesn't allow configuring this header, right? |
@jnicklas, no I backed out of my whole akephalos experiment because of this issue. |
I found one workaround, actually. The problem for me is the redirect in Devise when authentication fails. Solution: don't let authentication fail ;) So by changing:
That way we're going to the sign in page directly, the redirect never happens, all is good! |
FYI: I was able to fix the problem by changing the validate scripts setting. My application is Rails3 with prototype.js Capybara.register_driver :akephalos do |app| |
Unfortunately, this doesn't work for me... |
leifbladt: Did you ever solve this? We're having the same issue. |
No, unfortunately not. My workaround is to let these failing scenarios run with the selenium driver (which means they are not covered by our CI server...). |
I'm also getting this issue while trying to use the "visit" command in Capybara within a Javascript-enabled Cucumber test in Akephalos. The Javascript being executed is attaching event handlers to clicks on page load using JQuery 1.6. |
If you're getting UnexpectedPage as part of the error then try enabling debug output in htmlunit within akephalos. lib/akephalos/htmlunit.rb if using the gem or Capybara.register_driver :akephalos do |app|
Capybara::Driver::Akephalos.new(app, :htmlunit_log_level => "debug")
end in my fork. This gives you more information to see why htmlunit is throwing an UnexpectedPage. In my case, for a login form, I was not signing in successfully and being given a 401 which htmlunit loaded up as the UnexpectedPage. Turns out I needed to change DatabaseCleaner from transaction to truncation because transaction does not work properly with @javascript turned on. |
I switched from Selenium to Akephalos today. But one cucumber feature is not running.
I'm getting this error only in three scenarios inside one feature. The trigger is a "Then I should see 'something'". What happens before is a AJAX call which returns JavaScript, the client should execute. This works in other scenarios, but not in this one.
When I change the "I should see" to "Then show me the page", it also results in an error (undefined method 'getXml' this time).
The text was updated successfully, but these errors were encountered: