Automated testing of screen-share applications

2,864 views
Skip to first unread message

Boni García

unread,
Jan 21, 2015, 6:33:16 AM1/21/15
to discuss...@googlegroups.com
Hi all,

I am working on the automation of WebRTC based application with Selenium. Now I intend to automate an application in which a browser shares the desktop and another N browsers consume that media by WebRTC.

The way to to share the desktop using Chrome is to use the --enable-usermedia-screen-capturing flag and HTTPS. With this configuration, the browser sharing the desktop opens a pop-up asking for share user confirmation, as follows:

Do you want https://<ip>:<port> to share your desktop?
No Yes

Is it possible to avoid this popup?

I need to override this behaviour since the confirmation dialogue forces the test to be manual (i.e., a user clicking the "Yes" button). I tried to use the Chrome flag which avoids the popup to grant the access to the cam media (i.e. --use-fake-ui-for-media-stream) in conjunction with --enable-usermedia-screen-capturing, but it is not working to share the desktop.

Any idea to make it?

Thanks in advance!

Philipp Hancke

unread,
Jan 21, 2015, 10:21:28 AM1/21/15
to discuss...@googlegroups.com
http://code.google.com/p/chromium/issues/detail?id=372693#c8 looks like this might be possible though with a auto-select-desktop-capture-source flag.



--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Boni García

unread,
Jan 21, 2015, 11:18:50 AM1/21/15
to discuss...@googlegroups.com
Thanks for your reply Philipp.

I tried the --enable-usermedia-screen-capturing flag in conjunction with --auto-select-desktop-capture-source="Entire screen". I did it with Chrome stable, beta, and unstable (versions 39, 40, and 41)... but no luck: the popup for granting the screen sharing is still present.


--

---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/JU6jwFUa5T4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.

Jiayang Liu

unread,
Jan 22, 2015, 12:09:44 PM1/22/15
to discuss...@googlegroups.com
--auto-select-desktop-capture-source is supposed to do the job.

Which platform are you testing? Is the first media source in the window picker named "Entire screen"? 
The flag value must match the media source name.

Philipp Hancke

unread,
Jan 22, 2015, 12:12:50 PM1/22/15
to discuss...@googlegroups.com
2015-01-22 9:09 GMT-08:00 Jiayang Liu <ji...@google.com>:
--auto-select-desktop-capture-source is supposed to do the job.

But only with the new extension way, not with the old UI reenabled by --enable-usermedia-screen-capturing, right?

Jiayang Liu

unread,
Jan 22, 2015, 12:13:39 PM1/22/15
to discuss-webrtc
Yes, it only works with the extension way.

--

---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/JU6jwFUa5T4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Jiayang Liu

Boni García

unread,
Feb 9, 2015, 12:50:42 PM2/9/15
to discuss...@googlegroups.com
I am using Chome stable on Ubuntu 64 bits, with English locale. I am using this in the constraints:

constraints.video.mandatory.chromeMediaSource = 'screen';

Jiayang: Is that the media source name you referred?

Just in case, I tried to use the Chrome flag with this name:

--auto-select-desktop-capture-source="screen"

but still not luck...

Jiayang Liu

unread,
Feb 9, 2015, 2:03:19 PM2/9/15
to discuss-webrtc
No, it needs to be the string under the screen thumbnail when the window picker is open.

Patrik Höglund

unread,
Feb 10, 2015, 3:30:59 AM2/10/15
to discuss...@googlegroups.com
Hi Boni!

Unfortunately there's no way to bypass it, currently. --auto-select-desktop-capture-source will only affect the screen picker, where you are asked whether you want to share your screen, a window, or so on. This particular prompt doesn't have any bypass logic.

Please go ahead and file a bug. We can probably add a bypass flag. The code that launches the dialog is here if you want to comment it out and build your own Chrome for the time being to proceed with the test.

/ P

Boni García

unread,
Feb 18, 2015, 4:37:10 AM2/18/15
to discuss...@googlegroups.com
Hi Patrik,

Thanks a lot for your reply! I have just opened a bug in the Chromium list, just in case you can implemented some flag to bypass the popup.

Thanks again!

Kind regards,
Boni

--

Paul Davies

unread,
May 16, 2017, 4:05:54 AM5/16/17
to discuss-webrtc
Was this issue ever updated? I need to test an app which uses screen sharing from webrtc using a plugin

Philipp Hancke

unread,
May 16, 2017, 4:36:23 AM5/16/17
to discuss...@googlegroups.com
https://bugs.chromium.org/p/chromium/issues/detail?id=459532 comments 22 and 24 contain a workaround.
You might want to combine it with the auto-select-desktop-capture-source flag and preload the extension.
https://github.com/fippo/testbed/blob/master/webdriver.js does all that but I don't have a public example that shows all the things used together.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/443f28e5-e4d5-4010-a9a2-5686f145e79c%40googlegroups.com.

Paul Davies

unread,
May 16, 2017, 4:50:08 AM5/16/17
to discuss-webrtc
Does this actually work for you? I dont need the fix for permissions because like the plugin I can cache those in the browser (I use a real system with a real camera to do these tests). The thing that does not work for me is that the screen sharing UI is always displayed - even with that auto select flag. If it works for you then it means I'm doing something wrong (wouldnt be the first time) - but I am asking because I can not get this to work
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Philipp Hancke

unread,
May 16, 2017, 5:01:21 AM5/16/17
to discuss...@googlegroups.com
works for me (on linux systems, i've also seen it work on mac)

the most confusing thing is the argument you have to pass. It depends on the locale and the browser language so make sure it matches exactly what is display instead of "Entire Screen" :-/

To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/6c15cd5b-991e-4638-9969-14da6d6a61d5%40googlegroups.com.

Paul Davies

unread,
May 17, 2017, 8:40:55 AM5/17/17
to discuss-webrtc
For anyone who reads this later - I got it working with these options:

                 'use-fake-ui-for-media-stream', 
                 'enable-usermedia-screen-capturing',
                 'auto-select-desktop-capture-source=Screen 1',
                 'load-extension=<path to my screen sharing extension>,

Jahangir Muhammad

unread,
Sep 15, 2017, 1:41:52 AM9/15/17
to discuss-webrtc
That worked for me :thumbsup:
Reply all
Reply to author
Forward
0 new messages