Selenium WebDriver Chrome change fake video device name - selenium

There is a problem when you use video substitution, the device is defined as a video title file.
That is:
options.add_argument("--use-fake-device-for-media-stream")
options.add_argument("--use-file-for-fake-video-capture=video_camera.y4m")
device name 'video_camera.y4m'
The documentation says https://peter.sh/experiments/chromium-command-line-switches/ That two types of files can be used "mjpeg" or "y4m"
But you can't use a symlink, for example. I.e. you need to change the path to the file to a file without an extension.
What options can I use?

Related

How to customize the file name or get the file name of the saved mp4 file under video output folder of a specific test using selenium grid extras

Enabled video in the selenium grid extras config json file and able to see mp4 videos saved under video output folder.
How do I get the saved mp4 file name of a test programatically ?
Also, is it possible customize the file name to give it a meaningful name like testname_dateofexecution ?
RemoteWebdriver has a method GetCapabilities. Capability 'webdriver.remote.sessionId' returns the session id which is the file name of the mp4 file created in video output folder

Android apk download using Webdriver

I was trying to download the android apk file located at Hockey App share point but could only download a part of file not the complete file. Below is the code attached.
Below is the code that I have used to alter firefox configuration to handle the download pop-up
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("browser.download.folderList",2);
profile.setPreference("browser.download.manager.showWhenStarting",false);
// profile.setPreference("browser.download.dir", "Downloads");
profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/vnd.android.package-archive");// MIME type for apk file
WebDriver driver = new FirefoxDriver(profile);
Also, I tried using Content Type header("text/html; charset=utf-8") value shown in the Network monitor of Firefox. But that didn't work as well.
Any other approach other than Selenium is also appreciated.
Why don't you use the api provided by hockey app. Its pretty easy .. you can get the build url from available versions and then download. I have written a script pretty straightforward.
https://support.hockeyapp.net/kb/api
P.S. You should use the token from a developer account . Tester account doesnt get the build_url. But that shouldnt be difficult just ask for a read only token.

making VLC play external stream using VB.net

Hi I would like to programmatically make VLC play a video stream. I dont want to embed VLC just make it play. Normally I start VLC to play a local file like this
System.Diagnostics.Process.Start("VLC.exe", link to local file)
when I try the same process but supplying a vid stream I get an error saying the file cant be found.
System.Diagnostics.Process.Start("VLC.exe", "https://www.youtube.com/watch?v=y2C_3swE9sQ&list=PLrEnWoR732-BHrPp_Pm8_VleD68f9s14-&index=37")
It is supposed to be possible as per the instruction on VLC website:
To receive a HTTP stream, start VLC with : % vlc http://www.example.org/your_file.mpg but I can't seam to get it done.
Could someone point me in the right dirrection?
Your code works perfectly with VLC 2.2.1 which is the latest version.
To avoid The system cannot find the file specified error is better specify complete path of executable:
System.Diagnostics.Process.Start(
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe",
"https://www.youtube.com/watch?v=y2C_3swE9sQ&list=PLrEnWoR732-BHrPp_Pm8_VleD68f9s14-&index=37"
)
If you can't upgrade please note that this isn't a VB.NET problem but an incompatibility between new YouTube format and old versions of VLC: google vlc youtube.lua fix for a possible solution (not tested).

Changing background-image property to a local image file using Safari Extension

(MacBook Pro Mid 2015 / OS X Yosemite 10.10.5 / Safari 8.0.8)
I want to change background-image of a particular webpage.
I made a Safari Extension and make such a css file as style.css
body { background-image: url('background.png'); }
I also put background.png to the same directory with style.css
And Safari Developer license is already set.
Then, in Extension Builder, I set some properties as follows:
Extension Website Access: All
Injected Extension Content:
Style Sheets: style.css
Whitelist: http://__mywebsite__.com/*
Although I installed this, background of my webpage didn't seem to be enabled.
I think the solution must be these:
Safari Extension can't find a local file background.png
I set wrong whitelist pattern
I set wrong parameter to Extension Website Access
What should I do? Any comments would be thankful.
What happens if you link to an image on a web page, does it work? try putting this link in and see if it works: http://dummyimage.com/600x400/000/fff
If it does then the problem is with the directory or one of the other things you mentioned

Getting error in using SoundJS

I'm using Flash HTML5Canvas document to publish html files.
I want to add audio playback and started using SoundJS but having problems in using it.
I used the following code in the file.
createjs.Sound.registerPlugins([createjs.WebAudioPlugin, createjs.HTMLAudioPlugin, createjs.FlashPlugin]);
But when I publish it and and run it in browser(Chrome, Win7 Pro 64) I get the following error in console.
"Cannot read property registerPlugins of undefined"
When I checked the html source code, soundjs source is not mentioned. easeljs, tween & movieclip sources are mentioned.
How do I get this resolved?
Thanks :)
First I needed to edit the html file produced by flash cc.
I manually added the line
"http://code.createjs.com/soundjs-0.6.1.min.js"></script>
Double clicking the edited html file and running in browser gives HTTP errors.
So in the publish settings of Flash CC, I disabled the 'Overwrite HTML' option and then if I test/publish via Flash CC, Soundjs loads fine. It requires a local server to test it and I missed that part.