Tosca: Can we scan Notepad.exe? - tosca

So, as I'm learning Tosca, I tried to scan the simple program Notepad.exe that comes with windows... and I can't seem to figure it out. Is it even possible with Tosca 9.2? Is it possible with Tosca 10?
The best I was able to do so far was to scan Notepad as an "other", and switch on the Options > Use UIAEngine... and then it was only really able to see the main editbox... menu headers could be scanned, but none of the menu options like file > Open... or Edit > Replace... which would make being able to automate Notepad.exe useful.
Is it just not possible yet?

It is possible with TOSCA 10. I just tried and scanned Notepad instance with Desktop option from Module Folder > [right click] Scan Application > Desktop. It shows all the open browsers, Notepad instance, folders and desktop.
I scanned a module of Notepad which had only two attributes (because I selected only those) - Text area of Notepad and its close button. I created a test case where I inputted 'This' in the text area and clicked the close button. The test case also works fine.
Hope this helps!

The performance is much faster if you use the below modules instead of opening it UI. You can read/write and play around in the text file.
TBox Read/Create File
File system operations
TEXTSTREAM

Related

Eclipse WikiText: How to set css for preview?

Using Eclipse 2020-09 (i.e. v. 4.17) IDE for Java (on Linux, openSUSE Tumbleweed), with version 3.0.38 of Mylyn WikiText plugin installed, I had the following difficulty: Although pretty much all editor/ui fonts were fine, the HTML preview of WikiText files (in particular README.md!) displayed in unreadably small fonts (my display has a very small pixel pitch). So I wanted to find a way to set the CSS of such preview pages. The Mylyn WikiText docs (at https://help.eclipse.org/2020-09/index.jsp?topic=%2Forg.eclipse.mylyn.wikitext.help.ui%2Fhelp%2FMylyn+WikiText+User+Guide.html, under the heading "Rendering Appearance") says that there should be a Preferences screen General > Editors > Text Editor > WikiText > Appearance that allows one to set this CSS. However, no such screen shows up in my installation.
The only method I was able to find for fixing this was to use an application (such as Engrampa) which is able to edit the contents of .jar files, and in my eclipse installation directory, use it on plugins/org.eclipse.mylyn.wikitext.ui_3.0.[SPECIFIC_VERSION_HERE].jar to edit the internal component org/eclipse/mylyn/internal/wikitext/ui/viewer/default.css -- I could change any css there, and upon restarting Eclipse, the changes would take effect.
However, clearly any changes I make this way will be blown away upon the next update of Eclipse or of Mylyn Wikitext. Does anyone know of a better way to set the size of the preview text? Was that Appearance pane mentioned in the docs removed? If so, what replaced it? If not, any ideas why I might not be seeing it?

Notepad ++ Launch in Chrome equivalent in Atom

Do we have 'Launch in Chrome' equivalent in Atom. Screen shot of a similar functionality in Notepad++ is below:
There are several packages for Atom. E.g.
https://atom.io/packages/open-in-browser
opens a file in the default browser
https://atom.io/packages/open-in-browsers
a more configurable package where you can choose a browser
just to mention two of them, there are several more if you search the Atom packages site.
The easiest way that I have figured out how to open a file in your browser, is to right click the file that you desire to open on the left hand side of Atom, and click "Copy full path".
After you do that, just paste the full path into whichever browser you're using, and then you have your file opened in the browser.
This is the easiest way that I have found to do it. The packages seem to not want to work well for me.

How to handle File Upload in Robot Framework

I have excel importer in my application when I click on the "Upload" button I will get a pop up window with file upload screen where I can select the excel from the specified path. How to handle this in Robot Framework? Can any one help me how to handle the case?
Selenium2Library provides Choose File keyword for the same.
It takes two arguments, first is locator for the button and second is path to the file which needs to be uploaded.
e.g.
Choose File xpath=.//div/input ${TEMPDIR}${/}file_pa.csv
If you're using a dialog or input that WebDriver can interact with, then Sachin's answer about Choose File is the way to go.
If you're talking about the pre-HTML5 file-chooser dialogs provided by the browser, then Selenium2Library can't do this. However RobotFramework isn't just a wrapper around Selenium2Library so you can use something else that allows you to interact with the file upload screen.
I've done it in the past using AutoIt.
If you're not explicitly testing the upload dialog (and why should you, since it's provided as an atomic widget by your browser) then you should consider ways to simply avoid it. Perhaps a simple rest interface for uploading files.

Alignment plugin in Sublime Text does not work with style.less (less file)

As the title, i can't find the way to make alignment plugin available with .less file. It's just work on CSS File
I haven't tested this yet, but I have a pretty strong hunch that it might help your case.
Open sublime text, and go to Preferences>Browse Packages
Look for the Alignment plugin folder and enter in it.
Look at the files in there, you will see:
Base File.sublime-settings
CSS.sublime-settings
Javascript.sublime-settings
JSON.sublime-settings
Try your hand at creating a LESS.sublime-settings file in there, copying the contents of another of the settings files, for example, the JSON.sublime-settings contains this:
{ "alignment_chars": ["=", ":"] }
It seems to me, that to enable alignment to work as expected with other filetypes not designed as default with the plugin, one would have to add this settings file to the plugin in order for it to work out.
I am not sure if the file name has to be case sensitive towards the syntax you want align to work with. If you installed the less package, you should see "LESS" shows up in the list as all caps, this is why my guess is to name the file LESS.sublime-settings. You can try different naming if it doesn't go at first...
Open any LESS file in Sublime Text.
Navigate to:
- Preferences
-- Package Settings
--- Alignment
---- Settings-Syntax Specific-User
Alternatively, if you're on a Mac hit Command+Shift+P and start typing 'Alignment' and the option will appear. Once clicked, an empty JSON file will be generated for you: LESS.sublime-settings
As EffectiX mentioned, just type in { "alignment_chars": [":"] } or whatever you want to align on. Save the file. This will work with pretty much any file format if configured correctly.

Qt, PDF viewer, and jumping to specific pages

I've spent a couple of days searching the bowels of the internet to find out the answer to my question, so since I can't find the answer I'm throwing it out to the masses...
Within my Qt application I'm able to open a PDF using the OS default viewer thru the following command:
QDesktopServices::openUrl(QUrl("file:////C:help.pdf", QUrl::TolerantMode));
This works fine because all I'm wanting to do is display a help file to a user, but when I try to add a "#page=20" parameter to my URL, the document still only opens to the first page, not page 20. If I cut and paste the command into a browser it jumps correctly.
So -- my questions are:
Would poppler or another viewing tool allow me to jump to a page?
Is there another way with Qt to jump to a page? Or maybe another command to open the file instead of with QDesktopServices?
edit: I tried with QProcess and that doesn't jump to the page either -- not that I expected it to...
Use QProcess with one of the answers from Adobe Reader Command Line Reference :
<path to Adobe Reader> /A "page=100" "<Path To PDF file>"
Yes. evince, for example, takes option --page-index which you can set page number
No. QDesktopServices::openUrl() ends up calling one of helper commands, such as xdg-open or kfmclient, without any arguments.
Of cause, you can always use libpoppler in your app to open your PDFs. Poppler::Document::page() is your friend.
Another solution I was able to work out was to convert my PDF to HTML, create a QWebView, and display the HTML there. I then added an ID attribute to the HTML doc, and when I tacked that ID to my URL it loaded into the widget at the location of the attribute...
scott

Resources