Last Comment Bug 937659 - Implement page loading strategies
: Implement page loading strategies
Status: NEW
[marionette=1.0]
: ateam-marionette-client, ateam-marionette-server, ateam-marionette-spec
Product: Testing
Classification: Components
Component: Marionette (show other bugs)
: Trunk
: All All
: -- normal with 1 vote (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
http://w3c.github.io/webdriver/webdri...
: 936301 (view as bug list)
Depends on:
Blocks: webdriver 882186
  Show dependency treegraph
 
Reported: 2013-11-12 08:14 PST by Malini Das [:mdas] - Away, not checking bugmail
Modified: 2016-09-05 23:59 PDT (History)
9 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description User image Malini Das [:mdas] - Away, not checking bugmail 2013-11-12 08:14:33 PST
We currently implement what is closest to 'normal' page loading in WebDriver, but we should allow the user to decide what strategy they want to use for page loading: https://dvcs.w3.org/hg/webdriver/raw-file/tip/webdriver-spec.html#page-load-strategies-1

This spec mentions that we may select the strategy when we request a newSession, but I think that having a call like 'setPageLoadStrategy' would be useful if you want to explicitly set the strategy in the middle of a test. A use case for this would be where my test harness gives me a session that enforces 'normal' strategy, but I want to test the behaviour of a page as soon as its readyState is 'interactive', so instead of deleting and creating a new session, I can just dynamically change the strategy. Dburns, what do you think? Has this been discussed before?
Comment 1 User image Michael Henretty [:mhenretty] 2013-11-14 15:03:43 PST
For B2G, we need the ability to test pages that are in an "interactive" state. Specifically when apps or the browser displays an about:neterror page, we want the ability to test functionality on that page. For this use case, it would be extremely useful to be able to set the page loading strategy on the fly, so that we don't have to create a new session each time we want to navigate to our error page.

Based on Malini's comment here: https://bugzilla.mozilla.org/show_bug.cgi?id=936301#c3
Comment 2 User image Michael Henretty [:mhenretty] 2013-11-14 15:08:08 PST
*** Bug 936301 has been marked as a duplicate of this bug. ***
Comment 3 User image David Burns :automatedtester 2013-11-18 07:44:56 PST
(In reply to Malini Das [:mdas] from comment #0)
> We currently implement what is closest to 'normal' page loading in
> WebDriver, but we should allow the user to decide what strategy they want to
> use for page loading:
> https://dvcs.w3.org/hg/webdriver/raw-file/tip/webdriver-spec.html#page-load-
> strategies-1
> 
> This spec mentions that we may select the strategy when we request a
> newSession, but I think that having a call like 'setPageLoadStrategy' would
> be useful if you want to explicitly set the strategy in the middle of a
> test. A use case for this would be where my test harness gives me a session
> that enforces 'normal' strategy, but I want to test the behaviour of a page
> as soon as its readyState is 'interactive', so instead of deleting and
> creating a new session, I can just dynamically change the strategy. Dburns,
> what do you think? Has this been discussed before?


This hasnt been discussed before but at the moment I don't really understand the use case for changing this strategy mid-test. 

For context, the main reason this was added in the first place was due to CDNs taking the longest to reply to requests (ironic isnt it). As you know, I am wary of adding anything API that can have a knock on effect (or allows people not to write deterministic tests), especially around navigation for later tests and think the advice given in https://bugzilla.mozilla.org/show_bug.cgi?id=936301#c3 is sound. 

I would be all for adding special cases for about:* pages so we don't get stuck in the interactive state for "special" pages.
Comment 4 User image Malini Das [:mdas] - Away, not checking bugmail 2013-11-18 14:54:44 PST
(In reply to David Burns :automatedtester from comment #3)
> (In reply to Malini Das [:mdas] from comment #0)
> I would be all for adding special cases for about:* pages so we don't get
> stuck in the interactive state for "special" pages.

I think that works in this case, what do you think mhenretty?
Comment 5 User image Michael Henretty [:mhenretty] 2013-11-18 15:12:06 PST
(In reply to Malini Das [:mdas] from comment #4)
> (In reply to David Burns :automatedtester from comment #3)
> > (In reply to Malini Das [:mdas] from comment #0)
> > I would be all for adding special cases for about:* pages so we don't get
> > stuck in the interactive state for "special" pages.
> 
> I think that works in this case, what do you think mhenretty?

That would be great. Thank you!
Comment 6 User image Malini Das [:mdas] - Away, not checking bugmail 2013-11-18 15:36:14 PST
(In reply to Michael Henretty [:mhenretty] from comment #5)
> (In reply to Malini Das [:mdas] from comment #4)
> > (In reply to David Burns :automatedtester from comment #3)
> > > (In reply to Malini Das [:mdas] from comment #0)
> > > I would be all for adding special cases for about:* pages so we don't get
> > > stuck in the interactive state for "special" pages.
> > 
> > I think that works in this case, what do you think mhenretty?
> 
> That would be great. Thank you!

Okay, you can track that work here https://bugzilla.mozilla.org/show_bug.cgi?id=940084.

I'm leaving this bug open since we need to implement page loading strategy selection at *new session* as per spec requirements.

Note You need to log in before you can comment on or make changes to this bug.