Closed Bug 1503274 Opened 6 years ago Closed 6 years ago

[meta] Unwanted about:newtab page after navigation causes DOM interactions to fail

Categories

(Remote Protocol :: Marionette, enhancement, P1)

enhancement

Tracking

(firefox64 fixed, firefox65 fixed)

RESOLVED FIXED
mozilla65
Tracking Status
firefox64 --- fixed
firefox65 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

Details

(Keywords: meta)

Attachments

(1 file)

Attached image screenshot.png (deleted) —
We have a couple of Mn/MnH, and Wd failures which are related to this particular problem, and which I want to all make dependent on this bug. Basically what happens here is that a page load is triggered via Marionette, and which is successfully finished. But at this time Firefox doesn't show any content in the tab (see attached screenshot). It's just a blank page. Also retrieving elements fail because they cannot be found in the DOM.
With the fix on bug 1504807 it's now clear that we do not end-up at the requested URL but on `about:newtab`. Here a log snippet from a failure for bug 1503027: https://treeherder.mozilla.org/logviewer.html#?job_id=210228135&repo=autoland&lineNumber=27192-27204 > 1541556831121 Marionette TRACE 96 -> [0,18,"WebDriver:Navigate",{"url":"data:text/html;charset=utf-8,%0A%20%20%20%20%20%20%20%20%20%20%3Cinput%20type%3D%22text%22 ... B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%29%3B%0A%20%20%20%20%20%20%20%20%20%20%3C/script%3E%0A%20%20%20%20%20%20%20%20"}] > 1541556831153 Marionette DEBUG [8589934605] Frame script loaded > 1541556831163 Marionette DEBUG [8589934605] Frame script registered > 1541556831201 Marionette DEBUG [8589934605] Frame script loaded > 1541556831202 Marionette DEBUG [8589934605] Frame script registered > 1541556831299 Marionette DEBUG [8589934608] Frame script loaded > 1541556831318 Marionette DEBUG [8589934608] Frame script registered > 1541556831334 Marionette DEBUG [8589934605] Received DOM event beforeunload for about:newtab > 1541556831338 Marionette DEBUG [8589934605] Check readyState complete for about:newtab > 1541556831347 Marionette TRACE 96 <- [1,18,null,{"value":null}] > 1541556831364 Marionette TRACE 96 -> [0,19,"WebDriver:FindElement",{"using":"tag name","value":"input"}] > 1541556831367 Marionette DEBUG [8589934605] Check readyState complete for about:newtab > 1541556831421 Marionette TRACE 96 <- [1,19,{"error":"no such element","message":"Unable to locate element: input","stacktrace":"WebDriverError@chrome://marionette ... :532:3\nregisterSelf@chrome://marionette/content/listener.js:460:5\n@chrome://marionette/content/listener.js:1682:1\n"},null] The problem is actually here: https://searchfox.org/mozilla-central/source/testing/marionette/listener.js#149-161 After a frame script has been moved to a different content process, and registered itself again, we check for the `readyState` of the document to not unnecessarily register page load event listeners. Hereby `handleReadyState()` gets the `documentURI` which in this case is `about:newtab`. Given the magic of that page, it might have been loaded by Firefox before loading the actual page. The latter we don't recognize anymore because `readyState=complete` causes the command to return. I wonder if this is actually a problem with our `open_tab()` helper of the `WindowManagerMixin` class. It doesn't wait for the initial page (in this case about:newtab) of the new tab to be loaded, but immediately triggers a navigation request. Given the upcoming implementation for bug 1504756 the mixin class might not longer be necessary. So lets depend on it.
Depends on: 1504807, 1504756
Summary: [meta] Blank pages after navigation causes DOM interactions to fail → [meta] Unwanted about:newtab page after navigation causes DOM interactions to fail
Blocks: 1422769
Blocks: 1505567
The problem as reported on this bug should be the affect of loading `about:newtab` when opening a new tab. So far I thought that we don't do that, but bug 1506643 proved otherwise. With the landing of the patch on that other bug, we no longer use that about page but `about:blank`. As such this bug should no longer be present anymore now.
Assignee: nobody → hskupin
Status: NEW → RESOLVED
Closed: 6 years ago
Depends on: 1506643
No longer depends on: 1504756
Priority: -- → P1
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: