Skip to content

What is the purpose of navigation awaiting in Page.command method? #450

@lsndr

Description

@lsndr

I'd like to understand why this logic is present here:

ferrum/lib/ferrum/page.rb

Lines 344 to 353 in 5271866

if wait.positive?
# Wait a bit after command and check if iteration has
# changed which means there was some network event for
# the main frame and it started to load new content.
@event.wait(wait)
if iteration != @event.iteration
set = @event.wait(timeout)
raise TimeoutError unless set
end
end

I see that wait param passed in go_to method and some methods related to mouse events.

So basically it means if I click on element and navigation happens after down event, the click will fail if navigation doesn't finish within timeout despite the click was successful and led to navigation.

Shouldn't be this "wait for navigation" logic controlled by client and not included in mouse class?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions