Running mozmill test on standalone XUL application

91 views
Skip to first unread message

RGB

unread,
Nov 21, 2012, 8:10:10 AM11/21/12
to MozMill Developers
Hi there,

I am new to using mozmill and need some help with using it for our
automation test on XUL application. Here is a background on our
application and the steps I followed so far:

We have a standalone XUL application that runs outside of firefox in
the XUL window. I see that it has a windows title of XYZ on my windows
7 task manager.

I have downloaded the command line interface for mozmill (1.5.19) and
I am able to run mozmill test on on firefox. I see that if I give a
command
> mozmill

it invokes firefox. Is that normal behavior?

Now to test our application, I mostly followed the steps provided
here:
http://stackoverflow.com/questions/6873945/using-mozmill-for-testing-standalone-xul-applications

However, I haven't figured out how the extensions.ini gets invoked. If
someone can throw light on this, it would be great.

To run mozmill test on my XYZ application, I looked at a few
discussions here on mozmill group and tried adding the following to my
testxul.js

let window = mozmill.utils.getWindowByTitle("XYZ");
let pageInfoController = new
mozmill.controller.MozMillController(window);

When I run the command:
>mozmill --test=testxul.js --show-errors --show-all --timeout=120

It invokes firefox browser, and not the xul application and throws out
the following error message:

DEBUG | mozmill.startRunner | true
ERROR | Test Failure: {"exception": {"stack": "TimeoutError@resource://
mozmill/m
odules/utils.js:449\nwaitFor@resource://mozmill/modules/utils.js:
487\n@resource:
//mozmill/modules/controller.js:348\n@resource://mozmill/modules/
frame.js -> fil
e:///E:/mozmill/mozmill-1.5.19/test/testxul.js:2\n@resource://mozmill/modules/fr
ame.js:129\n@resource://mozmill/modules/frame.js:422\n@resource://
mozmill/module
s/frame.js:543\n@resource://mozmill/modules/frame.js:723\n@resource://
jsbridge/m
odules/server.js:179\n@resource://jsbridge/modules/server.js:
183\n@resource://js
bridge/modules/server.js:283\n", "message": "controller(): Window
could not be i
nitialized.", "fileName": "resource://mozmill/modules/utils.js",
"name": "Timeou
tError", "lineNumber": 449}}
TEST-UNEXPECTED-FAIL | E:\mozmill\mozmill-1.5.19\test\testxul.js |
testxul.js::<
TOP_LEVEL>
DEBUG | mozmill.endTest | {"passes": [], "fails": [{"exception":
{"message": "co
ntroller(): Window could not be initialized.", "lineNumber": 449}}],
"name": "te
stxul.js::<TOP_LEVEL>", "filename": "E:\\mozmill\\mozmill-1.5.19\\test\
\testxul.
js", "failed": 1, "passed": 0}

I do not think our application is modal. I already had the application
running before executing the tests.

Can you please let me what I am missing to run mozmill tests? Please
let me know if you need any more information.

Thank you! Appreciate any help.
RGB.

Dave Hunt

unread,
Nov 23, 2012, 5:15:19 AM11/23/12
to mozmi...@googlegroups.com
Hi RGB,

I must confess that I've not run Mozmill tests against anything other than Firefox or Firefox extensions, however I believe it should be able to run against a standalone XUL application. The reason it's launching Firefox by default is that there is automatic discovery of the application if the --binary command line option is omitted. Could you try providing the path to your application there and let us know the results.

Thanks,
Dave


RGB.

--
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.




--
Dave Hunt

RGB

unread,
Nov 23, 2012, 11:30:38 AM11/23/12
to mozmi...@googlegroups.com
Hi Dave,

Thanks for your response! I tried using the binary option. I think mozmill is looking for an exe. However, we do not have an exe file in our application. We have the application.ini and a .jnlp file (that we use for launching the app).

Here is what I tried unsuccessfully:

Initially, just using the application directory and got access denied.

E:\mozmill\mozmill-1.5.19\test>mozmill --test=testxul.js --show-errors --show-all --timeout=120 --binary="C:\Users\yyy\AppData\Roaming\xyz-dev"
Traceback (most recent call last):
  File "C:\Python27\Scripts\mozmill-script.py", line 8, in <module>
    load_entry_point('mozmill==1.5.19', 'console_scripts', 'mozmill')()
  File "C:\Python27\lib\site-packages\mozmill-1.5.19-py2.7.egg\mozmill\__init__.
py", line 846, in cli
    CLI().run()
  File "C:\Python27\lib\site-packages\mozmill-1.5.19-py2.7.egg\mozmill\__init__.
py", line 785, in run
    self.mozmill.start(runner=runner, profile=runner.profile)
  File "C:\Python27\lib\site-packages\mozmill-1.5.19-py2.7.egg\mozmill\__init__.
py", line 228, in start
    self.runner.start()
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\__ini
t__.py", line 508, in start
    self.process_handler = run_command(self.command+self.cmdargs, self.env, **se
lf.kp_kwargs)
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\__ini
t__.py", line 92, in run_command
    return killableprocess.Popen(cmd, env=env, **killable_kwargs)
  File "C:\Python27\lib\subprocess.py", line 679, in __init__
    errread, errwrite)
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\killa
bleprocess.py", line 152, in _execute_child
    cwd, startupinfo)
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\winpr
ocess.py", line 178, in ErrCheckCreateProcess
    ErrCheckBool(result, func, args)
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\winpr
ocess.py", line 55, in ErrCheckBool
    raise WinError()
WindowsError: [Error 5] Access is denied.

Then I tried using the jnlp file that I use to launch the standalone application as the binary and that did not work either.
E:\mozmill\mozmill-1.5.19\test>mozmill --test=testxul.js --show-errors --show-al
l --timeout=120 --binary="C:\Users\yyy\AppData\Roaming\xyz-dev\xyz.j
nlp"
Traceback (most recent call last):
  File "C:\Python27\Scripts\mozmill-script.py", line 8, in <module>
    load_entry_point('mozmill==1.5.19', 'console_scripts', 'mozmill')()
  File "C:\Python27\lib\site-packages\mozmill-1.5.19-py2.7.egg\mozmill\__init__.
py", line 846, in cli
    CLI().run()
  File "C:\Python27\lib\site-packages\mozmill-1.5.19-py2.7.egg\mozmill\__init__.
py", line 785, in run
    self.mozmill.start(runner=runner, profile=runner.profile)
  File "C:\Python27\lib\site-packages\mozmill-1.5.19-py2.7.egg\mozmill\__init__.
py", line 228, in start
    self.runner.start()
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\__ini
t__.py", line 508, in start
    self.process_handler = run_command(self.command+self.cmdargs, self.env, **se
lf.kp_kwargs)
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\__ini
t__.py", line 92, in run_command
    return killableprocess.Popen(cmd, env=env, **killable_kwargs)
  File "C:\Python27\lib\subprocess.py", line 679, in __init__
    errread, errwrite)
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\killa
bleprocess.py", line 152, in _execute_child
    cwd, startupinfo)
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\winpr
ocess.py", line 178, in ErrCheckCreateProcess
    ErrCheckBool(result, func, args)
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\winpr
ocess.py", line 55, in ErrCheckBool
    raise WinError()
WindowsError: [Error 193] <no description>

Then passed the application.ini file hoping that mozmill would recognize that:
E:\mozmill\mozmill-1.5.19\test>mozmill --test=testxul.js --show-errors --show-al
l --timeout=120 --binary="C:\Users\yyy\AppData\Roaming\xyz-dev\application.i
ni"
Traceback (most recent call last):
  File "C:\Python27\Scripts\mozmill-script.py", line 8, in <module>
    load_entry_point('mozmill==1.5.19', 'console_scripts', 'mozmill')()
  File "C:\Python27\lib\site-packages\mozmill-1.5.19-py2.7.egg\mozmill\__init__.
py", line 846, in cli
    CLI().run()
  File "C:\Python27\lib\site-packages\mozmill-1.5.19-py2.7.egg\mozmill\__init__.
py", line 785, in run
    self.mozmill.start(runner=runner, profile=runner.profile)
  File "C:\Python27\lib\site-packages\mozmill-1.5.19-py2.7.egg\mozmill\__init__.
py", line 228, in start
    self.runner.start()
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\__ini
t__.py", line 508, in start
    self.process_handler = run_command(self.command+self.cmdargs, self.env, **se
lf.kp_kwargs)
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\__ini
t__.py", line 92, in run_command
    return killableprocess.Popen(cmd, env=env, **killable_kwargs)
  File "C:\Python27\lib\subprocess.py", line 679, in __init__
    errread, errwrite)
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\killa
bleprocess.py", line 152, in _execute_child
    cwd, startupinfo)
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\winpr
ocess.py", line 178, in ErrCheckCreateProcess
    ErrCheckBool(result, func, args)
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\winpr
ocess.py", line 55, in ErrCheckBool
    raise WinError()
WindowsError: [Error 193] <no description>

I also tried using launching the xul application using a command to launch the application within binary:
E:\mozmill\mozmill-1.5.19\test>mozmill --test=testxul.js --show-all --timeout=12
0 --binary="firefox.exe -app C:\Users\yyy\AppData\Roaming\xyz-dev\applic
ation.ini"
Traceback (most recent call last):
  File "C:\Python27\Scripts\mozmill-script.py", line 8, in <module>
    load_entry_point('mozmill==1.5.19', 'console_scripts', 'mozmill')()
  File "C:\Python27\lib\site-packages\mozmill-1.5.19-py2.7.egg\mozmill\__init__.
py", line 846, in cli
    CLI().run()
  File "C:\Python27\lib\site-packages\mozmill-1.5.19-py2.7.egg\mozmill\__init__.
py", line 776, in run
    runner = self.create_runner()
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\__ini
t__.py", line 631, in create_runner
    runner = self.get_runner(binary=self.options.binary)
  File "C:\Python27\lib\site-packages\jsbridge-2.4.15-py2.7.egg\jsbridge\__init_
_.py", line 120, in get_runner
    runner = super(CLI, self).get_runner(*args, **kwargs)
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\__ini
t__.py", line 641, in get_runner
    return self.runner_class(binary, profile)
  File "C:\Python27\lib\site-packages\mozrunner-2.5.13-py2.7.egg\mozrunner\__ini
t__.py", line 394, in __init__
    raise Exception("Binary path does not exist "+self.binary)
Exception: Binary path does not exist firefox.exe -app C:\Users\yyy\AppData\
Roaming\xyz-dev\application.ini
Exception AttributeError: "'FirefoxRunner' object has no attribute 'profile'" in
 <bound method FirefoxRunner.cleanup of <mozrunner.FirefoxRunner object at 0x026
781F0>> ignored

Is there a way to launch the application.ini file from mozmill?

Thank you in advance!
RGB 

Henrik Skupin

unread,
Nov 30, 2012, 6:31:32 AM11/30/12
to mozmi...@googlegroups.com
On Fri, Nov 23, 2012 at 5:30 PM, RGB <ramya....@gmail.com> wrote:

Hi Ramya,
 
Lets see if we can find a solution for you.

Thanks for your response! I tried using the binary option. I think mozmill is looking for an exe. However, we do not have an exe file in our application. We have the application.ini and a .jnlp file (that we use for launching the app).

If you are using xul runner for your application you should have the xulrunner binary. You will have to specify the application.ini file as first argument to it. I believe that is what you have in the jnlp file?
 
E:\mozmill\mozmill-1.5.19\test>mozmill --test=testxul.js --show-errors --show-all --timeout=120 --binary="C:\Users\yyy\AppData\Roaming\xyz-dev"

What is 'xyz-dev'? That has to be a binary means an .exe file.
 
Then passed the application.ini file hoping that mozmill would recognize that:
E:\mozmill\mozmill-1.5.19\test>mozmill --test=testxul.js --show-errors --show-al
l --timeout=120 --binary="C:\Users\yyy\AppData\Roaming\xyz-dev\application.i
ni"

That will not work that way. When you pass the application.ini file you will have to do that via '--app-args'. See --help for more information.
 
E:\mozmill\mozmill-1.5.19\test>mozmill --test=testxul.js --show-all --timeout=12
0 --binary="firefox.exe -app C:\Users\yyy\AppData\Roaming\xyz-dev\applic
ation.ini"

When you are using -app you only should specify the name of your application. I assume in this case it woudl be 'xyz-dev'.
 
Please give us feedback if --app or --app-args are working.

Best,
Henrik

RGB

unread,
Dec 4, 2012, 12:12:09 PM12/4/12
to mozmi...@googlegroups.com
Hi Henrik,

It did not seem to work. I tried the test using the --apps-arg parameter to pass application.ini as:

C:\Users\yyy\AppData\Roaming\xyz-dev>mozmill --test="E:\mozmill\mozmill-1.5.19\test\testxul.js" --timeout=120 --app-arg="-app application.ini" --show-all

But got:

DEBUG | mozmill.startRunner | true
ERROR | Test Failure: {"exception": {"stack": "TimeoutError@resource:
odules/utils.js:449\nwaitFor@resource://mozmill/modules/utils.js:487\
//mozmill/modules/controller.js:348\n@resource://mozmill/modules/fram
e:///E:/mozmill/mozmill-1.5.19/test/testxul.js:2\n@resource://mozmill
ame.js:129\n@resource://mozmill/modules/frame.js:422\n@resource://moz
s/frame.js:543\n@resource://mozmill/modules/frame.js:723\n@resource:/
odules/server.js:179\n@resource://jsbridge/modules/server.js:183\n@re
bridge/modules/server.js:283\n", "message": "controller(): Window cou
nitialized.", "fileName": "resource://mozmill/modules/utils.js", "nam
tError", "lineNumber": 449}}
TEST-UNEXPECTED-FAIL | E:\mozmill\mozmill-1.5.19\test\testxul.js | te
TOP_LEVEL>
DEBUG | mozmill.endTest | {"passes": [], "fails": [{"exception": {"me
ntroller(): Window could not be initialized.", "lineNumber": 449}}],
stxul.js::<TOP_LEVEL>", "filename": "E:\\mozmill\\mozmill-1.5.19\\tes
js", "failed": 1, "passed": 0}
DEBUG | mozmill.setModule | "currentModule"
DEBUG | mozmill.persist
DEBUG | mozmill.endRunner | true
INFO Passed: 0
INFO Failed: 1
INFO Skipped: 0

Tried: 
C:\Users\yyy\AppData\Roaming\xyz-dev>mozmill --test="E:\mozmill\mozmill-1.5.19\test\testxul.js" --timeout=120 --app-arg="-app xyz" --show-all

That gave me the same error as well? Is there something else that I am missing? 

Thanks!
RGB

Henrik Skupin

unread,
Dec 10, 2012, 8:01:09 AM12/10/12
to mozmi...@googlegroups.com
On Tue, Dec 4, 2012 at 6:12 PM, RGB <ramya....@gmail.com> wrote:
 
It did not seem to work. I tried the test using the --apps-arg parameter to pass application.ini as:

C:\Users\yyy\AppData\Roaming\xyz-dev>mozmill --test="E:\mozmill\mozmill-1.5.19\test\testxul.js" --timeout=120 --app-arg="-app application.ini" --show-all

Oh wait. This reminds me on a bug I have filed not that long ago and which probably prevents you here from getting your application correctly registered. In mozrunner the order of CLI arguments gets shuffled but Firefox expects --application as the first argument. So we should be affected by bug 775416. Would you have the interest in helping us to get this bug fixed? I would really appreciate that and would offer any help you need to get it fixed.
 
Best,
Henrik

RGB

unread,
Feb 15, 2013, 1:56:46 PM2/15/13
to mozmi...@googlegroups.com, hsk...@gmail.com
Hi Henrik,

Finally have sometime to work on this issue....I thought it should be a simple fix based on the discussions in the bug description. 
I wanted to see it work with xul. So, I downloaded the source code and within mozmill/__init__.py, added a line runner.cmdargs.reverse() within CLI class, after the call to runner.cmdargs.extend(self.options.appArgs) and see that it passes --app as the first argument. However, I am still having issues. Am I missing something?

Thanks!

RGB

unread,
Feb 15, 2013, 10:10:22 PM2/15/13
to mozmi...@googlegroups.com
It seemed like that fix didnt do the trick. However I swapped the arguments in mozmill init.py that the -app argument comes before the jsbridge and port argument s. But that did not work as well.

To see mozmill working with xulrunner I modified the command in mozrunner init.py to pass the -app argument as second and -profile as third. But I couldn't get it to work.

Any help would be great

Thanks!

Henrik Skupin

unread,
Feb 25, 2013, 1:10:58 PM2/25/13
to mozmi...@googlegroups.com, RGB
RGB wrote on 2/16/13 4:10 AM:
Would you mind to give us a link to a xulrunner based application? I
would kinda like to have a look at myself.

Thanks

--
Henrik Skupin
Software Engineer in Test
Mozilla Corporation

RGB

unread,
Mar 1, 2013, 7:37:31 PM3/1/13
to mozmi...@googlegroups.com, RGB
Hi Henrik,

Had to jump hoops to upload a file :). Here is a sample xul app based on instructions from mozilla xulrunner. Please let me know if you need anything else. Unzipping this and executing xulrunner -app application.ini should bring up the sample app. 

Thanks!
Ramya.
TestXul.zip

Henrik Skupin

unread,
Mar 4, 2013, 5:47:47 PM3/4/13
to mozmi...@googlegroups.com, RGB
RGB wrote on 3/2/13 1:37 AM:

> Had to jump hoops to upload a file :). Here is a sample xul app based on
> instructions from mozilla xulrunner. Please let me know if you need
> anything else. Unzipping this and executing xulrunner -app
> application.ini should bring up the sample app.

Thanks. I have attached the file to the bug where we will follow-up.

Cheers
Reply all
Reply to author
Forward
0 new messages