I am using AppiumLibrary with Robot Framework and I want to set a default location for screenshots which were be taken when failure occurs.
The Capture Page Screenshot is the default keyword which will be executed on failure, but how can I set the default location for it?
I tried setting like this:
Library AppiumLibrary run_on_failure=Capture Page Screenshot filename=path/to/file.png
In this case, the filename parameter won't be considered.
Everything you need should be in the documentation https://serhatbolsu.github.io/robotframework-appiumlibrary/AppiumLibrary.html#Capture%20Page%20Screenshot
If you do not give an absolute path it is considered a relative path.
Related
In IcCube V7 reporting, I could use either absolute or relative path for referencing sub reports to be opened in an "embedded dashboard" widget.
I did not success to do the same in V8.2.2. (only absolute path seems to work)
Isn't it still an available functionality (relative path)? tried on the IcCube Live Demo with no luck :
This functionality is not (yet) added to the reporting. We'll add it to the next V8.3 release. Then, for example, you can use the relative path Repetition Widget instead of the absolute path shared:/Live Demo/Miscellaneous/Repetition Widget.
In an Capacitor/Ionic/Angular app I am trying to allow a user to take a video, view it in a <video> tag, and I also need to be able to send the video data in a POST request when the user submits it.
I'm getting the video using Cordova's MediaCapture plugin so what I get back contains a fullPath of the form file://...
The bit I'm stuck on is then actually getting a File/Blob object from the full path.
I tried using Filesystem.readFile() from Capacitor Plugins, but the problem is that it requires a path: string and a directory: FilesystemDirectory. If I try to just provide {path: fullPath} I get a "File does not exist" error. The FilesystemDirectory just gives me several options to choose from but I wouldn't want to use it as I already have the full path and don't want to go into checking which directory I should use in which device.
Is there any other way I can get around this?
use Capacitor.convertFileSrc('file:///path/to/video.mp4');, then you'll have a path that the webview understands and you can use fetch/xhr to that path to get the Blob. (Note that on iOS it won't work if running in live reload mode as iOS blocks requests from http scheme (used by the live reload server) to capacitor scheme (regular capacitor scheme when running normally)
Electron appears to remember what the zoom factor when restarting the app - where is this saved? I want to be able to reset this.
Thanks!
The zoom factor information for each browser window is memorized in a JSON file named Preferences located in the user data directory accessible through app.getPath ('userData');
If the zoom factor is different from its default value 1.0, it will be listed at the end of the JSON file (after the DevTools settings), associated with the window's URL. You may find the whole relevant syntax quite odd though...
As a user said, you must find Preferences file in C:\Users\<<username>>\AppData\Roaming\<<package name>>. I tried to change zoom value firstly but it didn't work. After I tried to change per_host_zoom_levels to 0 and it works.
So if you want to manipulate zoom from saved file, you must change per_host_zoom_levels.
I'm not sure about this, but could be in:
C:\Users\**<name>**\AppData\Local\Temp
and then in a folder relative of the name of the app.
The file structure should be C:\Users\%YOUR-USER%\AppData\Roaming\%YOUR-APP%\, edit the Preferences file with an editor (I used notepad), look for {per_host_zoom_levels": {"%SOME-NUMBER%":{%HERE%}}}. At the %HERE% part will have the zoom preference, delete the contents to reset and so that {per_host_zoom_levels": {"%SOME-NUMBER%":{}}} remains. Can augment to have different values as well. Hope it helps for future readers!
I am currently trying to figure out an issue with an Application Protocol Handler I've created. Following the directions listed on MSDN (http://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx), I was able to register my application, PDF Annotator, to open via a URL. The issue I am experiencing is when I try to pass a parameter along with the call. The application will open, but the file parameter that gets passed is not opening within the application.
My registry key is verbatim as dictated by MSDN. My HTML code is as follows:
PDFAnnotator:C:\path\to\file\file.pdf
The way I understood the protocol handler is it takes the URL and tries to launch it via the command line. That being said, I am able to open my pdf file in PDFAnnotator with following command in the prompt:
PDFAnnotator.exe C:\path\to\file\file.pdf
I've tried formatting the file path in the HTML differently thinking that would be the issue too. Has anyone else come across this issue or something similar?
Obligatory Update for future generations (http://xkcd.com/979/):
The reason I was doing this is because half of the PDFs my application handled would be editable while the other half were read-only. I was trying to keep the read-only ones in browser with the Acrobat plugin (I'm targeting chrome only) while the protocol would allow me to set the links of the editable ones to open with Annotator. I tried, on whim, to reverse this (setting the default to Annotator and creating a protocol for Acrobat). I did this, first by trying Acrobat's URI Scheme (acrobat://), which didn't work outside of opening Acrobat. Then, I tried creating a protocol for Acrobat. When that fired off, it gave me an error stating the path was wrong for the file name, path name, or volume. So, progress? I'm giving up on this for now as other priorities have come up, but hopefully this helps somebody down the road.
I am trying to write a custom xcode4 behavior to check out the current active file with Perforce. I know I can write a custom behavior to run when hit a key (e.g., F1) I'd like that custom behavior to launch an AppleScript (or any kind of script for that matter) that discerns the currently "active" source document in Xcode, get its path, and attempt to check it out via Perforce.
As far as I can tell AppleScript is the best way to get to the target document as it can navigate the Xcode DOM easily. Given that, the DOM itself is a maze.
Can this be done?
Yes.
tell application "Xcode"
set CurrentActiveDocument to document 1 whose name ends with (word -1 of (get name of window 1))
set WhatYouWant to path of CurrentActiveDocument
end tell