Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

marionette port

942 views
Skip to first unread message

Vangelis Katsikaros

unread,
Feb 8, 2016, 5:16:01 AM2/8/16
to tools-ma...@lists.mozilla.org
Hi

Let me explain what I want to do and a question I have.

I am running automation tests in parallel with webdriver and a perl client
(https://metacpan.org/pod/Selenium::Remote::Driver). When the default webriver
port is already taken, this client uses another unused port. So when 3 firefoxes
are launched with the perl client I can see:

$ netstat -tlp | grep firefox
tcp 0 0 localhost:9090 *:* LISTEN 13043/firefox
tcp 0 0 localhost:9091 *:* LISTEN 13246/firefox
tcp 0 0 localhost:9092 *:* LISTEN 13459/firefox

So it seems that there is a way to configure the port the webdriver is using.

I would like to integrate marionette to my tests, so that I run JS that requires
elevated privileges, like changing browser preferences.

My question: is there a way to control the port marionette is running, so that I
can launch 3 instances of firefox with marionette in ports 2828, 2829, 2830 (the
ports numbers are just examples).

Regards
Vangelis

Nicolas B. Pierron

unread,
Feb 8, 2016, 5:28:27 AM2/8/16
to Vangelis Katsikaros, tools-ma...@lists.mozilla.org
Hi,

On Mon, Feb 8, 2016 at 10:15 AM, Vangelis Katsikaros
<vkats...@gmail.com> wrote:
> My question: is there a way to control the port marionette is running, so
> that I can launch 3 instances of firefox with marionette in ports 2828,
> 2829, 2830 (the ports numbers are just examples).

Here is an example of how I do it:
https://github.com/nbp/arewefastyet/blob/master/driver/b2g-benchmark.sh#L485-L487

If I recall correctly, this --address argument is forwarded by
gaiatest to the marionette-client, so this should be the same for you.

--
Nicolas B. Pierron

Andreas Tolfsen

unread,
Feb 8, 2016, 6:26:10 AM2/8/16
to Vangelis Katsikaros, tools-ma...@lists.mozilla.org
On 8 February 2016 at 10:15, Vangelis Katsikaros <vkats...@gmail.com> wrote:
> My question: is there a way to control the port marionette is running, so
> that I can launch 3 instances of firefox with marionette in ports 2828,
> 2829, 2830 (the ports numbers are just examples).

You can set the preference marionette.defaultPrefs.port in the profile
you pass to Firefox.

James Graham

unread,
Feb 8, 2016, 6:37:30 AM2/8/16
to tools-ma...@lists.mozilla.org
Or, if you are using webdriver via wires, you can't explicitly pass a
profile but you can either start wires with --marionette-port, or start
a browser with a profile of your choice and then use wires to connect to
that existing instance. I don't know if these features are surfaced in
your client, however.

Vangelis Katsikaros

unread,
Feb 8, 2016, 7:35:34 AM2/8/16
to Andreas Tolfsen, tools-ma...@lists.mozilla.org
Hi Andreas

On 02/08/2016 01:25 PM, Andreas Tolfsen wrote:
> On 8 February 2016 at 10:15, Vangelis Katsikaros <vkats...@gmail.com> wrote:
>> My question: is there a way to control the port marionette is running, so
>> that I can launch 3 instances of firefox with marionette in ports 2828,
>> 2829, 2830 (the ports numbers are just examples).
>
> You can set the preference marionette.defaultPrefs.port in the profile
> you pass to Firefox.
>

Thanks for the answer, works fine!

$ cat firefox_profile/prefs.js
user_pref("lala.lala", "lala");
user_pref("marionette.defaultPrefs.port", 9999);

$ /usr/bin/firefox --profile ./firefox_profile/ -marionette &

$ netstat -tlp | grep firefox
tcp 0 0 localhost:9999 *:* LISTEN
32043/firefox

Regards
Vangelis

Andreas Tolfsen

unread,
Feb 8, 2016, 7:53:56 AM2/8/16
to Vangelis Katsikaros, tools-ma...@lists.mozilla.org
On 8 February 2016 at 12:35, Vangelis Katsikaros <vkats...@gmail.com> wrote:
> On 02/08/2016 01:25 PM, Andreas Tolfsen wrote:
>>
>> On 8 February 2016 at 10:15, Vangelis Katsikaros <vkats...@gmail.com>
>> wrote:
>>>
>>> My question: is there a way to control the port marionette is running, so
>>> that I can launch 3 instances of firefox with marionette in ports 2828,
>>> 2829, 2830 (the ports numbers are just examples).
>>
>>
>> You can set the preference marionette.defaultPrefs.port in the profile
>> you pass to Firefox.
>>
>
> Thanks for the answer, works fine!

I should add that I would recommend you to add support for the remote
W3C WebDriver protocol so that you can use wires
(https://github.com/jgraham/wires) instead. As James explained, it
accepts a flag to set the port.

All the major browsers will soon come out with W3C compatible remote
driver implementations.

Vangelis Katsikaros

unread,
Feb 17, 2016, 5:46:32 AM2/17/16
to Andreas Tolfsen, tools-ma...@lists.mozilla.org
Hi

On 02/08/2016 02:53 PM, Andreas Tolfsen wrote:
>
> I should add that I would recommend you to add support for the remote
> W3C WebDriver protocol so that you can use wires
> (https://github.com/jgraham/wires) instead. As James explained, it
> accepts a flag to set the port.

If I understand correctly marionette protocol was extended to support webdriver
calls, making webdriver API a subset of the marionette API. Notable commands
missing from the webdriver API is everything related to context.

What you are suggesting is to
* have wires up, and connected to the marionette server (firefox browser)
* send JsonWireProtocol-like commands to wires for context setting. It seems
wires can handle requests to "/session/{sessionId}/moz/context"

> All the major browsers will soon come out with W3C compatible remote
> driver implementations.

Does this mean that the browser's webdriver implementation will have support for
context switching?

Regards
Vangelis
0 new messages