[
http://jira.openqa.org/browse/WTR-470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jarmo Pertman reopened WTR-470:
-------------------------------
I'm not sure about this. I have seen that error myself in the situation where
there is some redirect happening caused by JavaScript for example:
1) page gets loaded
2) body onload event triggers javascript function
3) javascript function performs some nasty redirect
In this case it is possible to get that error. I'm not 100% sure, but i
strongly think so.
The reason could be that Browser#wait is not executed during that JavaScript
redirection so if you'd try to check if some element exists during the
redirection phase - e.g. the let's say that there is a completely white page
currently in the browser, so no DOM, nothing - then you might get that error.
In this situation you are in some sticky situation because you cannot just
wait_until some element exists to make sure that redirection has completed.
Only way would be to check for existance of the element AND rescue the possible
exception. Of course that error won't happen all the time.
I'm not sure if the same problem applies to reporter's case too. That's why i
asked questions from him/her.
I don't have any better ideas how to solve that problem also and maybe that
retrying wouldn't be such a bad idea afterall. Of course i'm not sure if that
would solve the problem i described.
I guess some test page with a lot of redirections happening could answer that
question. I'll look into it at some point.
> ole_inner_elements timing issue
> -------------------------------
>
> Key: WTR-470
> URL: http://jira.openqa.org/browse/WTR-470
> Project: Watir
> Issue Type: Bug
> Components: Wait
> Affects Versions: 1.6.7
> Environment: Running this on Windows XP with ie 7.
> Reporter: Dan Franko
> Assignee: Jarmo Pertman
> Priority: Major
>
> In container.rb sometimes when ole_inner_elements is called on account of
> locator.elements.nil? being nill, the document.body.all fails to return
> anything even when the browser is still present. I managed to patch it
> myself by inserting a rescue block, waiting a couple of seconds and trying
> again, but I'm sure there's a more elegant way of doing it.
> {quote}
> locator.elements = ole_inner_elements if locator.elements.nil?
> def ole_inner_elements
> return document.body.all
> end
> {quote}
> This is the error I get in this condition. This is testing a C# web app,
> which is using ajax.
> {quote}
> undefined method `all' for nil:NilClass
> ["c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/container.rb:776:in
> `ole_inner_elements'",
> "c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/container.rb:843:in
> `locate_input_element'",
> "c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/input_elements.rb:5:in
> `locate'",
> "c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb:308:in
> `exists?'", "./test_functions.rb:220:in `delete_user'",
> "./test_functions.rb:247:in `too_many_failed_logins'", "smoketest.rb:36"]
> {quote}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.openqa.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development