I used to have modal dialogs for the extension I'm working on,
and I was thus using the ModalDialogAPI shared module for interacting
with those windows. But now I'm using non-modal dialogs since it is
recommended as it makes a better user experience.
That leads to the question: How to get the elements inside
a newly opened non-modal window?
The Mozmill "graphic recorder" suggests using the following code:
controller2 = new
mozmill.controller.MozMillController(mozmill.utils.getWindowByTitle("Fidesfit:
configuration"));
But it doesn't work and return the following error:
ERROR | Test Failure: {"exception": {"message": "controller(): Window
could not be initialized.", "lineNumber": 421, "stack":
"Error(\"controller(): Window could not be
initialized.\")@:0\nwaitFor((function () {return window != null &&
window.documentLoaded != undefined;}),5000,100,\"controller(): Window
could not be
initialized.\")@file:///tmp/tmpJ-qqyH.mozrunner/extensions/moz...@mozilla.com/resource/modules/utils.js:421\n((void
0))@file:///tmp/tmpJ-qqyH.mozrunner/extensions/moz...@mozilla.com/resource/modules/controller.js:152\n()@file:///tmp/tmpJ-qqyH.mozrunner/extensions/moz...@mozilla.com/resource/modules/frame.js
->
file:///home/firefox/fidesfi...@fidesfit.org/test/mozmill/tests/test_configure.js:82
I'm using mozmill 1.5.0
And here is a precedent email threading tackling the subject:
http://groups.google.com/group/mozmill-dev/browse_thread/thread/11a796825a2e6fe8
Could someone help me on this please?
PS: "utils.getWindowByTitle" is rightly present in the Mozmill code,
but not documented on https://developer.mozilla.org/
--
M.-A. DARCHE https://developer.mozilla.org/User:madarche
AFUL http://aful.org/
Association Francophone des Utilisateurs de Logiciels Libres
French speaking Libre Software Users' Association
> That leads to the question: How to get the elements inside
> a newly opened non-modal window?
I would suggest that you should use the handleWindow function from utilsAPI:
http://hg.mozilla.org/qa/mozmill-tests/file/tip/shared-modules/testUtilsAPI.js#l361
--
Henrik Skupin
QA Execution Engineer
Mozilla Corporation
Thanks a lot Florian and Henrik.
I'll let the list know asap when it works,
and add the related documentation on the concerned pages on
https://developer.mozilla.org/
Cheers,
--
You received this message because you are subscribed to the Google Groups "MozMill Developers" group.
To post to this group, send email to mozmi...@googlegroups.com.
To unsubscribe from this group, send email to mozmill-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mozmill-dev?hl=en.
This is the route I have chosen, because it includes a built-in wait for
the window to appear. And it works.
I'll document it ASAP
Thanks!