<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>20947</bug_id>
          
          <creation_ts>2013-02-11 13:22:42 +0000</creation_ts>
          <short_desc>[WebDriver Spec]: Click does not mention if it should/shouldnt wait for page loads if its noticed</short_desc>
          <delta_ts>2016-09-19 16:03:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Browser Test/Tools WG</product>
          <component>WebDriver</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>ASSIGNED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>20860</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="David Burns :automatedtester">dburns</reporter>
          <assigned_to name="Simon Stewart">simon.m.stewart</assigned_to>
          <cc>james</cc>
    
    <cc>luke.semerau</cc>
    
    <cc>mike</cc>
    
    <cc>samuong</cc>
    
    <cc>simon.m.stewart</cc>
    
    <cc>vlotoshnikov</cc>
          
          <qa_contact name="Browser Testing and Tools WG">public-browser-tools-testing</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>82895</commentid>
    <comment_count>0</comment_count>
    <who name="David Burns :automatedtester">dburns</who>
    <bug_when>2013-02-11 13:22:42 +0000</bug_when>
    <thetext>Currently the spec does not mention if we should use and page load strategies when interact with links. Currently the OSS project does a number of different things in these situations</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82899</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Stewart">simon.m.stewart</who>
    <bug_when>2013-02-11 14:51:04 +0000</bug_when>
    <thetext>Clicks are assumed to be asynchronous. Therefore the browser can return whenever it wants to, perhaps before any click handlers have fired or JS being processed. Tests are required to determine when it&apos;s safe to proceed.

This is largely because there&apos;s no way of telling beforehand whether a click will cause a page load or not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102608</commentid>
    <comment_count>2</comment_count>
    <who name="David Burns :automatedtester">dburns</who>
    <bug_when>2014-03-18 22:03:28 +0000</bug_when>
    <thetext>*** Bug 24960 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122196</commentid>
    <comment_count>3</comment_count>
    <who name="">samuong</who>
    <bug_when>2015-07-17 23:02:33 +0000</bug_when>
    <thetext>PageLoadingTest.testShouldTimeoutIfAPageTakesTooLongToLoadAfterClick() requires that the driver waits (and eventually times out) after clicking on a link:

https://github.com/SeleniumHQ/selenium/blob/01399fffecd5a20af6f31aed6cb0043c9c5cde65/java/client/test/org/openqa/selenium/PageLoadingTest.java#L419

Section 6 of the current spec says &quot;For commands that cause a new document to load...return after the load event fires on the new page&quot; (for a normal page loading strategy), but I&apos;m not sure if this applies only to the navigation commands in that section or any command that causes a new document to load:

https://w3c.github.io/webdriver/webdriver-spec.html#navigation

But Simon&apos;s also right in that a click is asynchronous and it&apos;s not easy to tell if a click handler will navigate to a new page or not. In the worst case, a click handler might do an animation (or something else that takes time) before navigating.

It&apos;d be good if there was a decision on exactly what should happen here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122197</commentid>
    <comment_count>4</comment_count>
    <who name="seva">vlotoshnikov</who>
    <bug_when>2015-07-17 23:47:35 +0000</bug_when>
    <thetext>I am for simplicity and against spec requirements that I don&apos;t believe that vendors will thoroughly implement. So I +1 Comment 1.

Also https://github.com/joshbruning (from whom we will hear more and more) as well as jleyba and other people have different good ideas in this area. Such as WebDriver exposing hooks that app under test (e.g. web ui frameworks) can use to tell that page has finished loading. Ideas that might make it easy to implement on the WebDriver side and easy for web ui frameworks (or just web apps) to integrate with - making test code free of explicit waits.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122198</commentid>
    <comment_count>5</comment_count>
    <who name="seva">vlotoshnikov</who>
    <bug_when>2015-07-17 23:48:40 +0000</bug_when>
    <thetext>(Those kinds of things could go in Level 2 and extensions of the standard)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122208</commentid>
    <comment_count>6</comment_count>
    <who name="Simon Stewart">simon.m.stewart</who>
    <bug_when>2015-07-18 10:32:15 +0000</bug_when>
    <thetext>This isn&apos;t an extension: it&apos;s already defined behaviour. Normal clicks should use the page loading strategy to tell if the driver needs to wait. Advanced user interaction clicks need not do so. 

Getting the AUT to help provide hints is nothing to do with webdriver and everything to do with good testing strategy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122220</commentid>
    <comment_count>7</comment_count>
    <who name="seva">vlotoshnikov</who>
    <bug_when>2015-07-20 10:35:15 +0000</bug_when>
    <thetext>I know that pageLoadStrategy is currently specified in the draft.
I also know that pageLoad[ing]Strategy strategy existed in Selenium/WebDriver for a while.

However I don&apos;t know of a driver that would fully implement all of the strategies without missing and buggy behavior (am I missing one?). That is why I support dropping pageLoadStrategy capability from the spec while we can. (and also for the reasons I mentioned in Comment 4)

I read your Comment 1, Simon, as one against the notion of pageLoadStrategy (for both normal clicks and advanced user interactions), perhaps I misunderstood.

&gt;&gt; Getting the AUT to help provide hints is nothing to do with webdriver and everything to do with good testing strategy.

(sorry for bringing that up, this bug isn&apos;t right place for this discussion) 

It may have something to do with WebDriver if we want WebDriver commands to never return control before the &quot;page is fully loaded&quot; in the Whole sense: by the definition of the application under test. And I think we do. We will discuss this separately when time will come...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123897</commentid>
    <comment_count>8</comment_count>
    <who name="James Graham">james</who>
    <bug_when>2015-10-26 00:46:28 +0000</bug_when>
    <thetext>So one way to handle this that makes sense is to let the event loop spin until any event handlers that would be fired by the click event have run. This may simply be equivalent to setTimeout(function() {return_from_click_command()}, 0), but I will check with DOM.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127411</commentid>
    <comment_count>9</comment_count>
    <who name="David Burns :automatedtester">dburns</who>
    <bug_when>2016-09-19 16:03:23 +0000</bug_when>
    <thetext>action item from TPAC Lisbon</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>